Child

inner class Child

Represents a labeled child of the gauge metric.

Use this to operate on a specific label set:

gauge.labels("GET").inc()

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
suspend fun dec()

Decrements the gauge by 1.

suspend fun dec(amount: Double)

Decrements the gauge by the specified amount(must be non-negative).

Link copied to clipboard
fun get(): Double

Gets the current value of the gauge.

Link copied to clipboard
suspend fun inc()

Increments the gauge by 1.

suspend fun inc(amount: Double)

Increments the gauge by the specified amount (must be non-negative).

Link copied to clipboard
suspend fun set(amount: Double)

Sets the gauge to a specific value.

Link copied to clipboard
suspend fun <T> Gauge.Child.setDuration(block: () -> T): T

Measures the duration of a block and stores it in the labeled Gauge.Child.

Link copied to clipboard
suspend fun setToCurrentTime()

Sets the gauge value to the current Unix time in seconds.

Link copied to clipboard
inline suspend fun <T> Gauge.Child.track(block: () -> T): T

Increments the labeled gauge while the block is running, and decrements it when the block completes.