Sha256: d480ec69d31f2123edd04cc0702db34e2114dc376bf8d2504ed4a5f452ed5b08
Contents?: true
Size: 733 Bytes
Versions: 13
Compression:
Stored size: 733 Bytes
Contents
module Scout module Realtime class Runner attr_accessor :num_runs def initialize @num_runs = 0 @collectors = Scout::Realtime::Metric.descendants.map(&:new) end def run @collectors.each(&:run!) @num_runs += 1 end def latest_run gather_from_collectors(:latest_run) end def historical_metrics gather_from_collectors(:historical_metrics) end private def gather_from_collectors(value) @collectors.inject({}) do |collection, collector| name = collector.class.short_name collection[name] = collector.send(value) collection end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems