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
208 209 210 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 208 def initialize @value = 0 end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
211 212 213 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 211 def value @value end |
Instance Method Details
#add(value) ⇒ Object
217 218 219 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 217 def add(value) @value += 1 end |
#mode ⇒ Object
221 222 223 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 221 def mode UpdateMode::ADD end |
#normalized_value(n) ⇒ Object
213 214 215 |
# File 'lib/fluent/plugin/out_metricsense.rb', line 213 def normalized_value(n) @value end |