Class: Prometheus::Client::SimpleValue
- Inherits:
-
Object
- Object
- Prometheus::Client::SimpleValue
- Defined in:
- lib/prometheus/client/simple_value.rb
Class Method Summary collapse
Instance Method Summary collapse
- #decrement(by = 1) ⇒ Object
- #get ⇒ Object
- #increment(by = 1) ⇒ Object
-
#initialize(_type, _metric_name, _name, _labels, *_args) ⇒ SimpleValue
constructor
A new instance of SimpleValue.
- #set(value) ⇒ Object
Constructor Details
#initialize(_type, _metric_name, _name, _labels, *_args) ⇒ SimpleValue
Returns a new instance of SimpleValue.
6 7 8 |
# File 'lib/prometheus/client/simple_value.rb', line 6 def initialize(_type, _metric_name, _name, _labels, *_args) @value = 0.0 end |
Class Method Details
.multiprocess ⇒ Object
26 27 28 |
# File 'lib/prometheus/client/simple_value.rb', line 26 def self.multiprocess false end |
Instance Method Details
#decrement(by = 1) ⇒ Object
18 19 20 |
# File 'lib/prometheus/client/simple_value.rb', line 18 def decrement(by = 1) @value -= by end |
#get ⇒ Object
22 23 24 |
# File 'lib/prometheus/client/simple_value.rb', line 22 def get @value end |
#increment(by = 1) ⇒ Object
14 15 16 |
# File 'lib/prometheus/client/simple_value.rb', line 14 def increment(by = 1) @value += by end |
#set(value) ⇒ Object
10 11 12 |
# File 'lib/prometheus/client/simple_value.rb', line 10 def set(value) @value = value end |