Package com.azure.core.util.metrics
Interface LongGauge
public interface LongGauge
A counter instrument that records
long values.
Counters only allow adding positive values, and guarantee the resulting metrics will be always-increasing monotonic sums.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanFlag indicating if metric implementation is detected and functional, use it to minimize performance impact associated with metrics, e.g. measuring latency.registerCallback(Supplier<Long> valueSupplier, TelemetryAttributes attributes) Registers callbacks to obtain measurements.
-
Method Details
-
registerCallback
Registers callbacks to obtain measurements. Make sure to close result to stop reporting metric.- Parameters:
valueSupplier- Callback that will periodically be requested to obtain current value.attributes- Collection of attributes representing metric dimensions. Caller that wants to record dynamic attributes, should register callback per each attribute combination.- Returns:
- instance of
AutoCloseablesubscription.
-
isEnabled
boolean isEnabled()Flag indicating if metric implementation is detected and functional, use it to minimize performance impact associated with metrics, e.g. measuring latency.- Returns:
trueif enabled,falseotherwise
-