Class: Yabeda::Gauge
Overview
Arbitrary value, can be changed in both sides
Instance Attribute Summary
Attributes inherited from Metric
#adapter, #aggregation, #comment, #group, #name, #per, #tags, #unit
Instance Method Summary collapse
-
#decrement(tags = {}, by: 1) ⇒ Object
Convenience method to decrement current gauge value for given set of tags by the given decrement value.
-
#increment(tags = {}, by: 1) ⇒ Object
Convenience method to increment current gauge value for given set of tags by the given increment value.
- #set(tags, value) ⇒ Object
Methods inherited from Metric
#adapters, #get, #initialize, #inspect, #values
Constructor Details
This class inherits a constructor from Yabeda::Metric
Instance Method Details
#decrement(tags = {}, by: 1) ⇒ Object
28 29 30 31 |
# File 'lib/yabeda/gauge.rb', line 28 def decrement(*args) , by = Counter.parse_args(*args) set(, get().to_i - by) end |
#increment(tags = {}, by: 1) ⇒ Object
19 20 21 22 |
# File 'lib/yabeda/gauge.rb', line 19 def increment(*args) , by = Counter.parse_args(*args) set(, get().to_i + by) end |