class MetricsCr::Metrics::Gauge

Defined in:

metrics_cr/metrics/gauge.cr

Instance Method Summary

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

[View source]
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

[View source]
def value : Float64 #

[View source]
def value=(value : Float64) #

[View source]