# class Prometheus::Gauge

- Prometheus::Gauge
- Prometheus::Metric
- Reference
- Object

##
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:

- Current memory usage
- Number of items in a queue
- Number of active connections

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

- #collect : Array(Sample)
- #dec(value : Number = 1)
- #inc(value : Number = 1)
- #set(value : Number)
- #type : String
- #value : Float64

### 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 #