createAsyncUpDownCounter

abstract fun createAsyncUpDownCounter(name: String, callback: LongUpDownCounterCallback, units: String? = null, description: String? = null): AsyncMeasurementHandle

Create a new async up down counter.

Return

a AsyncMeasurementHandle which can be used for de-registering the counter and stopping the callback from being invoked.

Parameters

name

the instrument name

callback

the callback to invoke when reading the counter value. NOTE: Unlike synchronous counters that record delta values, async measurements record absolute/current values.

units

the unit of measure

description

the human-readable description of the measurement