Class: Sqreen::Metric::Collect

Inherits:
Base
  • Object
show all
Defined in:
lib/sqreen/metrics/collect.rb

Overview

This is an aggregated statistic definition This is a base class to collect metrics in a hash based structure that does not aggregate anything

Instance Attribute Summary

Attributes inherited from Base

#name, #period, #rule

Instance Method Summary collapse

Methods inherited from Base

#initialize, #next_sample

Constructor Details

This class inherits a constructor from Sqreen::Metric::Base

Instance Method Details

#update(key, value) ⇒ Object

from class attr_accessor :aggregate



16
17
18
19
20
21
# File 'lib/sqreen/metrics/collect.rb', line 16

def update(key, value)
  super
  s = @sample[OBSERVATION_KEY]
  s[key] ||= []
  s[key] << value
end