Class: Prometheus::Client::Counter
- Inherits:
-
Metric
- Object
- Metric
- Prometheus::Client::Counter
show all
- Defined in:
- lib/prometheus/client/counter.rb
Instance Method Summary
collapse
Methods inherited from Metric
#get, #initialize, #to_json
Instance Method Details
#decrement(labels = {}, by = 1) ⇒ Object
15
16
17
|
# File 'lib/prometheus/client/counter.rb', line 15
def decrement(labels = {}, by = 1)
increment(labels, -by)
end
|
#increment(labels = {}, by = 1) ⇒ Object
10
11
12
13
|
# File 'lib/prometheus/client/counter.rb', line 10
def increment(labels = {}, by = 1)
label_set = label_set_for(labels)
synchronize { @values[label_set] += by }
end
|
#type ⇒ Object
6
7
8
|
# File 'lib/prometheus/client/counter.rb', line 6
def type
:counter
end
|