Class: Fluent::LibratoMetricsOutput::MaxAggregator
- Inherits:
-
Object
- Object
- Fluent::LibratoMetricsOutput::MaxAggregator
- Defined in:
- lib/fluent/plugin/out_librato_metrics.rb
Overview
max(value) aggregator
Instance Method Summary collapse
- #add(value) ⇒ Object
- #get ⇒ Object
-
#initialize ⇒ MaxAggregator
constructor
A new instance of MaxAggregator.
Constructor Details
#initialize ⇒ MaxAggregator
Returns a new instance of MaxAggregator.
135 136 137 |
# File 'lib/fluent/plugin/out_librato_metrics.rb', line 135 def initialize @value = 0 end |
Instance Method Details
#add(value) ⇒ Object
139 140 141 |
# File 'lib/fluent/plugin/out_librato_metrics.rb', line 139 def add(value) @value = value if @value < value end |
#get ⇒ Object
143 144 145 146 147 |
# File 'lib/fluent/plugin/out_librato_metrics.rb', line 143 def get # librato metrics's counter only supports integer: # 'invalid value for Integer(): "0.06268015"' @value.to_i end |