Class: Apmlens::Configuration
- Inherits:
-
Object
- Object
- Apmlens::Configuration
- Defined in:
- lib/apmlens/configuration.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#ingestion_key ⇒ Object
Returns the value of attribute ingestion_key.
-
#large_result_threshold ⇒ Object
Returns the value of attribute large_result_threshold.
-
#max_queue_limit ⇒ Object
Returns the value of attribute max_queue_limit.
-
#max_samples_limit ⇒ Object
Returns the value of attribute max_samples_limit.
-
#max_series_limit ⇒ Object
Returns the value of attribute max_series_limit.
-
#service ⇒ Object
Returns the value of attribute service.
-
#slow_query_threshold ⇒ Object
Returns the value of attribute slow_query_threshold.
Instance Method Summary collapse
- #disable! ⇒ Object
- #enable! ⇒ Object
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/apmlens/configuration.rb', line 9 def initialize @ingestion_key = ENV["APMLENS_KEY"] @service = "ruby-app" @endpoint = ENV.fetch("APMLENS_ENDPOINT", "https://app.apmlens.com") @environment = ENV.fetch("RAILS_ENV", "development") @enabled = false @max_series_limit = 2_000 @max_samples_limit = 100_000 @max_queue_limit = 1_000 @slow_query_threshold = 500 # ms @large_result_threshold = 2000 # records end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
5 6 7 |
# File 'lib/apmlens/configuration.rb', line 5 def endpoint @endpoint end |
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/apmlens/configuration.rb', line 5 def environment @environment end |
#ingestion_key ⇒ Object
Returns the value of attribute ingestion_key.
5 6 7 |
# File 'lib/apmlens/configuration.rb', line 5 def ingestion_key @ingestion_key end |
#large_result_threshold ⇒ Object
Returns the value of attribute large_result_threshold.
5 6 7 |
# File 'lib/apmlens/configuration.rb', line 5 def large_result_threshold @large_result_threshold end |
#max_queue_limit ⇒ Object
Returns the value of attribute max_queue_limit.
5 6 7 |
# File 'lib/apmlens/configuration.rb', line 5 def max_queue_limit @max_queue_limit end |
#max_samples_limit ⇒ Object
Returns the value of attribute max_samples_limit.
5 6 7 |
# File 'lib/apmlens/configuration.rb', line 5 def max_samples_limit @max_samples_limit end |
#max_series_limit ⇒ Object
Returns the value of attribute max_series_limit.
5 6 7 |
# File 'lib/apmlens/configuration.rb', line 5 def max_series_limit @max_series_limit end |
#service ⇒ Object
Returns the value of attribute service.
5 6 7 |
# File 'lib/apmlens/configuration.rb', line 5 def service @service end |
#slow_query_threshold ⇒ Object
Returns the value of attribute slow_query_threshold.
5 6 7 |
# File 'lib/apmlens/configuration.rb', line 5 def slow_query_threshold @slow_query_threshold end |
Instance Method Details
#disable! ⇒ Object
30 31 32 |
# File 'lib/apmlens/configuration.rb', line 30 def disable! @enabled = false end |
#enable! ⇒ Object
26 27 28 |
# File 'lib/apmlens/configuration.rb', line 26 def enable! @enabled = true end |
#enabled? ⇒ Boolean
22 23 24 |
# File 'lib/apmlens/configuration.rb', line 22 def enabled? @enabled && !@ingestion_key.nil? end |