Class: Lens::Rails::Configuration
- Inherits:
-
Object
- Object
- Lens::Rails::Configuration
- Defined in:
- lib/lens/rails/configuration.rb
Instance Attribute Summary collapse
-
#app_token ⇒ Object
Returns the value of attribute app_token.
-
#exporter_open_timeout ⇒ Object
Returns the value of attribute exporter_open_timeout.
-
#exporter_read_timeout ⇒ Object
Returns the value of attribute exporter_read_timeout.
-
#max_log_buffer ⇒ Object
Returns the value of attribute max_log_buffer.
-
#min_log_severity ⇒ Object
Returns the value of attribute min_log_severity.
-
#service_name ⇒ Object
Returns the value of attribute service_name.
-
#shutdown_timeout ⇒ Object
Returns the value of attribute shutdown_timeout.
-
#sql_ignore ⇒ Object
Returns the value of attribute sql_ignore.
-
#sql_threshold_ms ⇒ Object
Returns the value of attribute sql_threshold_ms.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #configured? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_token ⇒ Object
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_timeout ⇒ Object
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_timeout ⇒ Object
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_buffer ⇒ Object
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_severity ⇒ Object
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_name ⇒ Object
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_timeout ⇒ Object
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_ignore ⇒ Object
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_ms ⇒ Object
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 |
#url ⇒ Object
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
23 24 25 |
# File 'lib/lens/rails/configuration.rb', line 23 def configured? !url.to_s.empty? && !app_token.to_s.empty? end |