Class: ScoutApm::PeriodicWork
- Inherits:
-
Object
- Object
- ScoutApm::PeriodicWork
- Defined in:
- lib/scout_apm/periodic_work.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(context) ⇒ PeriodicWork
constructor
A new instance of PeriodicWork.
-
#run ⇒ Object
Expected to be called many times over the life of the agent.
Constructor Details
#initialize(context) ⇒ PeriodicWork
Returns a new instance of PeriodicWork.
5 6 7 8 |
# File 'lib/scout_apm/periodic_work.rb', line 5 def initialize(context) @context = context @reporting = ScoutApm::Reporting.new(context) end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
3 4 5 |
# File 'lib/scout_apm/periodic_work.rb', line 3 def context @context end |
Instance Method Details
#run ⇒ Object
Expected to be called many times over the life of the agent
11 12 13 14 15 16 17 18 19 |
# File 'lib/scout_apm/periodic_work.rb', line 11 def run ScoutApm::Debug.instance.call_periodic_hooks @reporting.process_metrics clean_old_percentiles if context.config.value('auto_instruments') log_autoinstrument_significant_counts rescue nil end end |