Crometheus::Gauge
Inherits Crometheus::Metric / Reference / Object
Gauge is a Metric type that stores a single value internally.
This value can be modified freely via instance methods.
require "crometheus/gauge"
body_temperature = Crometheus::Gauge.new(
:body_temperature, "Human body temperature")
body_temperature.set 98.6
# Running a fever...
body_temperature.inc 1.8
# Partial recovery
body_temperature.dec 0.6
body_temperature.get # => 99.8
Class methods
Instance methods
count_concurrent
Increments the gauge value, yields, then decrements the gauge value. Wrap your event handlers with this to find out how many events are being processed at a time.