Class: TwemproxyExporter::Gauge
- Inherits:
-
Object
- Object
- TwemproxyExporter::Gauge
- Defined in:
- lib/twemproxy_exporter/gauge.rb
Instance Method Summary collapse
- #count(value, labels = {}) ⇒ Object
-
#initialize(registry, name, desc) ⇒ Gauge
constructor
A new instance of Gauge.
- #value(labels = {}) ⇒ Object
Constructor Details
#initialize(registry, name, desc) ⇒ Gauge
Returns a new instance of Gauge.
3 4 5 6 |
# File 'lib/twemproxy_exporter/gauge.rb', line 3 def initialize(registry, name, desc) @gauge = Prometheus::Client::Gauge.new(name, desc) registry.register(@gauge) end |
Instance Method Details
#count(value, labels = {}) ⇒ Object
8 9 10 |
# File 'lib/twemproxy_exporter/gauge.rb', line 8 def count(value, labels = {}) @gauge.set(labels, value) end |
#value(labels = {}) ⇒ Object
12 13 14 |
# File 'lib/twemproxy_exporter/gauge.rb', line 12 def value(labels = {}) @gauge.get(labels) end |