class MetricsCr::Metrics::Gauge
- MetricsCr::Metrics::Gauge
- MetricsCr::Metric
- Reference
- Object
Defined in:
metrics_cr/metrics/gauge.crInstance Method Summary
-
#decrement(by : Float64 = 1.0) : Nil
Decrements the gauge by provided value.
-
#increment(by : Float64 = 1.0) : Nil
Increments the counter by provided value.
- #value : Float64
- #value=(value : Float64)
Instance methods inherited from class MetricsCr::Metric
name : String
name
Constructor methods inherited from class MetricsCr::Metric
new(name : String)
new
Instance Method Detail
def decrement(by : Float64 = 1.0) : Nil
#
Decrements the gauge by provided value.
gauge = MetricsCr::Metrics::Gauge.new(name: "test")
gauge.value = 3.14159 # => Nil
gauge.decrement(by: 1.1) # => Nil
gauge.value # => 2.04159
def increment(by : Float64 = 1.0) : Nil
#
Increments the counter by provided value.
gauge = MetricsCr::Metrics::Gauge.new(name: "test")
gauge.value = 3.14159 # => Nil
gauge.increment(by: 1.1) # => Nil
gauge.value # => 3.24159