Class: Sqreen::Metric::Sum

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

Overview

This perform a sum aggregation

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



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