Class: Scout::Realtime::Runner
Instance Attribute Summary collapse
-
#num_runs ⇒ Object
Returns the value of attribute num_runs.
Instance Method Summary collapse
- #historical_metrics ⇒ Object
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #latest_run ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
6 7 8 9 |
# File 'lib/scout_realtime/runner.rb', line 6 def initialize @num_runs = 0 @collectors = Scout::Realtime::Metric.descendants.map(&:new) end |
Instance Attribute Details
#num_runs ⇒ Object
Returns the value of attribute num_runs.
4 5 6 |
# File 'lib/scout_realtime/runner.rb', line 4 def num_runs @num_runs end |
Instance Method Details
#historical_metrics ⇒ Object
20 21 22 |
# File 'lib/scout_realtime/runner.rb', line 20 def historical_metrics gather_from_collectors(:historical_metrics) end |
#latest_run ⇒ Object
16 17 18 |
# File 'lib/scout_realtime/runner.rb', line 16 def latest_run gather_from_collectors(:latest_run) end |
#run ⇒ Object
11 12 13 14 |
# File 'lib/scout_realtime/runner.rb', line 11 def run @collectors.each(&:run!) @num_runs += 1 end |