Class: Fluent::MetricSenseOutput::CountUpdater
- Inherits:
-
Object
- Object
- Fluent::MetricSenseOutput::CountUpdater
- Defined in:
- lib/fluent/plugin/out_metricsense.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #add(value) ⇒ Object
-
#initialize ⇒ CountUpdater
constructor
A new instance of CountUpdater.
- #mode ⇒ Object
- #normalized_value(n) ⇒ Object
Constructor Details
#initialize ⇒ CountUpdater
Returns a new instance of CountUpdater.
211 212 213 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 211 def initialize @value = 0 end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
214 215 216 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 214 def value @value end |
Instance Method Details
#add(value) ⇒ Object
220 221 222 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 220 def add(value) @value += 1 end |
#mode ⇒ Object
224 225 226 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 224 def mode UpdateMode::ADD end |
#normalized_value(n) ⇒ Object
216 217 218 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 216 def normalized_value(n) @value end |