Class ExtendedDefaultMeter

java.lang.Object
io.opentelemetry.api.incubator.metrics.ExtendedDefaultMeter
All Implemented Interfaces:
Meter

@ThreadSafe class ExtendedDefaultMeter extends Object implements Meter
No-op implementation of Meter.

This implementation should induce as close to zero overhead as possible.

  • Field Details

    • INSTANCE

      private static final Meter INSTANCE
    • NOOP_LONG_COUNTER_BUILDER

      private static final LongCounterBuilder NOOP_LONG_COUNTER_BUILDER
    • NOOP_LONG_UP_DOWN_COUNTER_BUILDER

      private static final LongUpDownCounterBuilder NOOP_LONG_UP_DOWN_COUNTER_BUILDER
    • NOOP_DOUBLE_HISTOGRAM_BUILDER

      private static final DoubleHistogramBuilder NOOP_DOUBLE_HISTOGRAM_BUILDER
    • NOOP_DOUBLE_GAUGE_BUILDER

      private static final DoubleGaugeBuilder NOOP_DOUBLE_GAUGE_BUILDER
    • NOOP_BATCH_CALLBACK

      private static final BatchCallback NOOP_BATCH_CALLBACK
    • NOOP_OBSERVABLE_DOUBLE_MEASUREMENT

      private static final ObservableDoubleMeasurement NOOP_OBSERVABLE_DOUBLE_MEASUREMENT
    • NOOP_OBSERVABLE_LONG_MEASUREMENT

      private static final ObservableLongMeasurement NOOP_OBSERVABLE_LONG_MEASUREMENT
  • Constructor Details

    • ExtendedDefaultMeter

      private ExtendedDefaultMeter()
  • Method Details

    • getNoop

      static Meter getNoop()
    • counterBuilder

      public LongCounterBuilder counterBuilder(String name)
      Description copied from interface: Meter
      Constructs a Counter instrument.

      This is used to build both synchronous instruments and asynchronous instruments (i.e. callbacks).

      Specified by:
      counterBuilder in interface Meter
      Parameters:
      name - the name of the Counter. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, /, and start with a letter.
      Returns:
      a builder for configuring a Counter instrument. Defaults to recording long values, but may be changed.
      See Also:
    • upDownCounterBuilder

      public LongUpDownCounterBuilder upDownCounterBuilder(String name)
      Description copied from interface: Meter
      Constructs an UpDownCounter instrument.

      This is used to build both synchronous instruments and asynchronous instruments (i.e. callbacks).

      Specified by:
      upDownCounterBuilder in interface Meter
      Parameters:
      name - the name of the UpDownCounter. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, /, and start with a letter.
      Returns:
      a builder for configuring an UpDownCounter instrument. Defaults to recording long values, but may be changed.
      See Also:
    • histogramBuilder

      public DoubleHistogramBuilder histogramBuilder(String name)
      Description copied from interface: Meter
      Constructs a Histogram instrument.
      Specified by:
      histogramBuilder in interface Meter
      Parameters:
      name - the name of the Histogram. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, /, and start with a letter.
      Returns:
      a builder for configuring a Histogram synchronous instrument. Defaults to recording double values, but may be changed.
      See Also:
    • gaugeBuilder

      public DoubleGaugeBuilder gaugeBuilder(String name)
      Description copied from interface: Meter
      Constructs an Asynchronous Gauge instrument.
      Specified by:
      gaugeBuilder in interface Meter
      Parameters:
      name - the name of the Gauge. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, /, and start with a letter.
      Returns:
      a builder used for configuring a Gauge instrument. Defaults to recording double values, but may be changed.
      See Also:
    • batchCallback

      public BatchCallback batchCallback(Runnable callback, ObservableMeasurement observableMeasurement, ObservableMeasurement... additionalMeasurements)
      Description copied from interface: Meter
      Constructs a batch callback.

      Batch callbacks allow a single callback to observe measurements for multiple asynchronous instruments.

      The callback will be called when the instruments are being observed.

      Callbacks are expected to abide by the following restrictions:

      • Run in a finite amount of time.
      • Safe to call repeatedly, across multiple threads.
      • Only observe values to registered instruments (i.e. observableMeasurement and additionalMeasurements
      Specified by:
      batchCallback in interface Meter
      Parameters:
      callback - a callback used to observe values on-demand.
      observableMeasurement - Instruments for which the callback may observe values.
      additionalMeasurements - Instruments for which the callback may observe values.