Class: InnerPerformance::Configuration
- Inherits:
-
Object
- Object
- InnerPerformance::Configuration
- Defined in:
- lib/inner_performance/configuration.rb
Instance Attribute Summary collapse
-
#cleanup_immediately ⇒ Object
Returns the value of attribute cleanup_immediately.
-
#events_retention ⇒ Object
Returns the value of attribute events_retention.
-
#ignore_rules ⇒ Object
Returns the value of attribute ignore_rules.
-
#ignored_event_names ⇒ Object
Returns the value of attribute ignored_event_names.
-
#medium_duration_range ⇒ Object
Returns the value of attribute medium_duration_range.
-
#sample_rates ⇒ Object
Returns the value of attribute sample_rates.
-
#traces_enabled ⇒ Object
Returns the value of attribute traces_enabled.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/inner_performance/configuration.rb', line 13 def initialize @sample_rates = { "process_action.action_controller" => 2, "perform.active_job" => 100, } @events_retention = 1.week @medium_duration_range = [200, 999] @ignore_rules = [ proc { |event| rand(100_000.0) > (InnerPerformance.configuration.sample_rates[event.name.to_s] * 1000) }, proc { |event| (event.payload[:job]&.class&.name || "").include?("InnerPerformance") }, ] @cleanup_immediately = false @traces_enabled = false @ignored_event_names = [ "SCHEMA", "TRANSACTION", "ActiveRecord::InternalMetadata Load", "ActiveRecord::SchemaMigration Load", ] end |
Instance Attribute Details
#cleanup_immediately ⇒ Object
Returns the value of attribute cleanup_immediately.
5 6 7 |
# File 'lib/inner_performance/configuration.rb', line 5 def cleanup_immediately @cleanup_immediately end |
#events_retention ⇒ Object
Returns the value of attribute events_retention.
5 6 7 |
# File 'lib/inner_performance/configuration.rb', line 5 def events_retention @events_retention end |
#ignore_rules ⇒ Object
Returns the value of attribute ignore_rules.
5 6 7 |
# File 'lib/inner_performance/configuration.rb', line 5 def ignore_rules @ignore_rules end |
#ignored_event_names ⇒ Object
Returns the value of attribute ignored_event_names.
5 6 7 |
# File 'lib/inner_performance/configuration.rb', line 5 def ignored_event_names @ignored_event_names end |
#medium_duration_range ⇒ Object
Returns the value of attribute medium_duration_range.
5 6 7 |
# File 'lib/inner_performance/configuration.rb', line 5 def medium_duration_range @medium_duration_range end |
#sample_rates ⇒ Object
Returns the value of attribute sample_rates.
5 6 7 |
# File 'lib/inner_performance/configuration.rb', line 5 def sample_rates @sample_rates end |
#traces_enabled ⇒ Object
Returns the value of attribute traces_enabled.
5 6 7 |
# File 'lib/inner_performance/configuration.rb', line 5 def traces_enabled @traces_enabled end |