Class: Fluent::MetricSenseOutput::MaxUpdater
- Inherits:
-
Object
- Object
- Fluent::MetricSenseOutput::MaxUpdater
- Defined in:
- lib/fluent/plugin/out_metricsense.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #add(value) ⇒ Object
-
#initialize ⇒ MaxUpdater
constructor
A new instance of MaxUpdater.
- #mode ⇒ Object
- #normalized_value(n) ⇒ Object
Constructor Details
#initialize ⇒ MaxUpdater
Returns a new instance of MaxUpdater.
196 197 198 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 196 def initialize @value = 0 end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
199 200 201 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 199 def value @value end |
Instance Method Details
#add(value) ⇒ Object
205 206 207 208 209 210 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 205 def add(value) if @value < value @value = value end @value end |
#mode ⇒ Object
212 213 214 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 212 def mode UpdateMode::MAX end |
#normalized_value(n) ⇒ Object
201 202 203 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 201 def normalized_value(n) @value end |