Class: Fluent::MetricSenseOutput::MaxUpdater

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMaxUpdater

Returns a new instance of MaxUpdater.



193
194
195
# File 'lib/fluent/plugin/out_metricsense.rb', line 193

def initialize
  @value = 0
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



196
197
198
# File 'lib/fluent/plugin/out_metricsense.rb', line 196

def value
  @value
end

Instance Method Details

#add(value) ⇒ Object



202
203
204
205
206
207
# File 'lib/fluent/plugin/out_metricsense.rb', line 202

def add(value)
  if @value < value
    @value = value
  end
  @value
end

#modeObject



209
210
211
# File 'lib/fluent/plugin/out_metricsense.rb', line 209

def mode
  UpdateMode::MAX
end

#normalized_value(n) ⇒ Object



198
199
200
# File 'lib/fluent/plugin/out_metricsense.rb', line 198

def normalized_value(n)
  @value
end