Class: Fluent::LibratoMetricsOutput::MaxAggregator

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

Overview

max(value) aggregator

Instance Method Summary collapse

Constructor Details

#initializeMaxAggregator

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

#getObject



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