Class: Lens::Rails::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/lens/rails/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/lens/rails/configuration.rb', line 10

def initialize
  @url = ENV["LENS_URL"]
  @app_token = ENV["LENS_APP_TOKEN"]
  @service_name = ENV.fetch("LENS_SERVICE_NAME") { default_service_name }
  @max_log_buffer = 10_000
  @min_log_severity = ::Logger::INFO
  @sql_threshold_ms = 0.0
  @sql_ignore = []
  @exporter_open_timeout = 2
  @exporter_read_timeout = 2
  @shutdown_timeout = 5
end

Instance Attribute Details

#app_tokenObject

Returns the value of attribute app_token.



4
5
6
# File 'lib/lens/rails/configuration.rb', line 4

def app_token
  @app_token
end

#exporter_open_timeoutObject

Returns the value of attribute exporter_open_timeout.



4
5
6
# File 'lib/lens/rails/configuration.rb', line 4

def exporter_open_timeout
  @exporter_open_timeout
end

#exporter_read_timeoutObject

Returns the value of attribute exporter_read_timeout.



4
5
6
# File 'lib/lens/rails/configuration.rb', line 4

def exporter_read_timeout
  @exporter_read_timeout
end

#max_log_bufferObject

Returns the value of attribute max_log_buffer.



4
5
6
# File 'lib/lens/rails/configuration.rb', line 4

def max_log_buffer
  @max_log_buffer
end

#min_log_severityObject

Returns the value of attribute min_log_severity.



4
5
6
# File 'lib/lens/rails/configuration.rb', line 4

def min_log_severity
  @min_log_severity
end

#service_nameObject

Returns the value of attribute service_name.



4
5
6
# File 'lib/lens/rails/configuration.rb', line 4

def service_name
  @service_name
end

#shutdown_timeoutObject

Returns the value of attribute shutdown_timeout.



4
5
6
# File 'lib/lens/rails/configuration.rb', line 4

def shutdown_timeout
  @shutdown_timeout
end

#sql_ignoreObject

Returns the value of attribute sql_ignore.



4
5
6
# File 'lib/lens/rails/configuration.rb', line 4

def sql_ignore
  @sql_ignore
end

#sql_threshold_msObject

Returns the value of attribute sql_threshold_ms.



4
5
6
# File 'lib/lens/rails/configuration.rb', line 4

def sql_threshold_ms
  @sql_threshold_ms
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/lens/rails/configuration.rb', line 4

def url
  @url
end

Instance Method Details

#configured?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/lens/rails/configuration.rb', line 23

def configured?
  !url.to_s.empty? && !app_token.to_s.empty?
end