Class SdkLongGauge

java.lang.Object
io.opentelemetry.sdk.metrics.AbstractInstrument
io.opentelemetry.sdk.metrics.SdkLongGauge
All Implemented Interfaces:
ExtendedLongGauge, LongGauge

final class SdkLongGauge extends AbstractInstrument implements ExtendedLongGauge
  • Field Details

  • Constructor Details

  • Method Details

    • set

      public void set(long value, Attributes attributes)
      Description copied from interface: LongGauge
      Records a value with a set of attributes.
      Specified by:
      set in interface LongGauge
      Parameters:
      value - The current gauge value.
      attributes - A set of attributes to associate with the value.
    • set

      public void set(long value, Attributes attributes, Context context)
      Description copied from interface: LongGauge
      Records a value with a set of attributes.
      Specified by:
      set in interface LongGauge
      Parameters:
      value - The current gauge value.
      attributes - A set of attributes to associate with the value.
      context - The explicit context to associate with this measurement.
    • set

      public void set(long increment)
      Description copied from interface: LongGauge
      Set the gauge value.
      Specified by:
      set in interface LongGauge
      Parameters:
      increment - The current gauge value.
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: ExtendedLongGauge
      Returns true if the gauge is enabled.

      This allows callers to avoid unnecessary compute when nothing is consuming the data. Because the response is subject to change over the application, callers should call this before each call to LongGauge.set(long), LongGauge.set(long, Attributes), or LongGauge.set(long, Attributes, Context).

      Specified by:
      isEnabled in interface ExtendedLongGauge