Class: Fluent::MetricSenseOutput::MaxUpdater

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

Direct Known Subclasses

AverageUpdater

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMaxUpdater

Returns a new instance of MaxUpdater.



227
228
229
# File 'lib/fluent/plugin/out_metricsense.rb', line 227

def initialize
  @value = 0
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



230
231
232
# File 'lib/fluent/plugin/out_metricsense.rb', line 230

def value
  @value
end

Instance Method Details

#add(value) ⇒ Object



236
237
238
239
240
241
# File 'lib/fluent/plugin/out_metricsense.rb', line 236

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

#modeObject



243
244
245
# File 'lib/fluent/plugin/out_metricsense.rb', line 243

def mode
  UpdateMode::MAX
end

#normalized_value(n) ⇒ Object



232
233
234
# File 'lib/fluent/plugin/out_metricsense.rb', line 232

def normalized_value(n)
  @value
end