Module: Scout::Realtime::MultiAggregator

Included in:
Disk, Network, Processes
Defined in:
lib/scout_realtime/lib/multi_aggregator.rb

Instance Method Summary collapse

Instance Method Details

#update_historical_metrics(collector_response) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'lib/scout_realtime/lib/multi_aggregator.rb', line 2

def update_historical_metrics(collector_response)
  # since this is a multi-collector, the first level of the result hash is name
  collector_response.each_pair do |name,metrics_hash|
    historical_metrics[name] ||= {}
    self.class::FIELDS.keys.each do |field_name|
      historical_metrics[name][field_name] ||= RingBuffer.new(60)
      historical_metrics[name][field_name].push(metrics_hash[field_name])
    end
  end
end