Class: Fluent::LibratoMetricsOutput::CounterAggregator
- Inherits:
-
Object
- Object
- Fluent::LibratoMetricsOutput::CounterAggregator
- Defined in:
- lib/fluent/plugin/out_librato_metrics.rb
Overview
max(value) aggregator
Instance Method Summary collapse
- #add(value) ⇒ Object
- #get ⇒ Object
-
#initialize ⇒ CounterAggregator
constructor
A new instance of CounterAggregator.
Constructor Details
#initialize ⇒ CounterAggregator
Returns a new instance of CounterAggregator.
114 115 116 |
# File 'lib/fluent/plugin/out_librato_metrics.rb', line 114 def initialize @value = 0 end |
Instance Method Details
#add(value) ⇒ Object
118 119 120 |
# File 'lib/fluent/plugin/out_librato_metrics.rb', line 118 def add(value) @value = value if @value < value end |
#get ⇒ Object
122 123 124 125 126 |
# File 'lib/fluent/plugin/out_librato_metrics.rb', line 122 def get # librato metrics's counter only supports integer: # 'invalid value for Integer(): "0.06268015"' @value.to_i end |