GaugeBuilder

Builder class for creating Gauge metrics.

Gauges represent a value that can increase and decrease, such as memory usage or number of active sessions.

Parameters

name

The metric name.

Constructors

Link copied to clipboard
constructor(name: String)

Constructs a gauge builder.

Functions

Link copied to clipboard
open override fun build(): Gauge

Builds and returns the Gauge instance.

Link copied to clipboard
fun clock(clock: Clock)

Sets a custom Clock for this metric, useful for testing or time manipulation.

Link copied to clipboard
fun help(help: String)

Sets the help description for the metric.

Link copied to clipboard
fun labelNames(vararg labelNames: String)

Sets the label names that this metric will use.

Link copied to clipboard
fun unit(unit: String)

Sets the unit of the metric.