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 Type
    Method
    Description
    boolean
    Flag indicating if metric implementation is detected and functional, use it to minimize performance impact associated with metrics, e.g.
    registerCallback(Supplier<Long> valueSupplier, TelemetryAttributes attributes)
    Registers callbacks to obtain measurements.
  • Method Details

    • registerCallback

      AutoCloseable registerCallback(Supplier<Long> valueSupplier, TelemetryAttributes attributes)
      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 AutoCloseable subscription.
    • 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:
      true if enabled, false otherwise