Class: Fluent::LibratoMetricsOutput::CounterAggregator

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/out_librato_metrics.rb

Overview

max(value) aggregator

Instance Method Summary collapse

Constructor Details

#initializeCounterAggregator

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

#getObject



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