Class: Sqreen::Metric::Sum
Overview
This perform a sum aggregation
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#update(key, value) ⇒ Object
from class attr_accessor :aggregate.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Sqreen::Metric::Base
Instance Method Details
#update(key, value) ⇒ Object
from class attr_accessor :aggregate
14 15 16 17 18 19 |
# File 'lib/sqreen/metrics/sum.rb', line 14 def update(key, value) super s = @sample[OBSERVATION_KEY] s[key] ||= 0 s[key] += value end |