class Prometheus::Gauge

Overview

A Gauge is a metric that represents a single numerical value that can arbitrarily go up and down.

Use a Gauge for metrics that can increase and decrease, such as:

Example:

gauge = Gauge.new("cpu_usage", "CPU usage percentage")
gauge.set(45.2)  # Set to specific value
gauge.inc(5)     # Increase by 5
gauge.dec(3)     # Decrease by 3

Defined in:

metrics.cr

Instance Method Summary

Instance methods inherited from class Prometheus::Metric

collect : Array(Sample) collect, help : String help, labels : LabelSet labels, name : String name, type : String type

Constructor methods inherited from class Prometheus::Metric

new(name : String, help : String, labels : Prometheus::LabelSet = LabelSet.new) new

Instance Method Detail

def collect : Array(Sample) #

def dec(value : Number = 1) #

def inc(value : Number = 1) #

def set(value : Number) #

def type : String #

def value : Float64 #