Class ExtendedDefaultMeter
java.lang.Object
io.opentelemetry.api.incubator.metrics.ExtendedDefaultMeter
- All Implemented Interfaces:
Meter
No-op implementation of
Meter.
This implementation should induce as close to zero overhead as possible.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Meterprivate static final BatchCallbackprivate static final DoubleGaugeBuilderprivate static final DoubleHistogramBuilderprivate static final LongCounterBuilderprivate static final LongUpDownCounterBuilderprivate static final ObservableDoubleMeasurementprivate static final ObservableLongMeasurement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbatchCallback(Runnable callback, ObservableMeasurement observableMeasurement, ObservableMeasurement... additionalMeasurements) Constructs a batch callback.counterBuilder(String name) Constructs a Counter instrument.gaugeBuilder(String name) Constructs an Asynchronous Gauge instrument.(package private) static MetergetNoop()histogramBuilder(String name) Constructs a Histogram instrument.upDownCounterBuilder(String name) Constructs an UpDownCounter instrument.
-
Field Details
-
INSTANCE
-
NOOP_LONG_COUNTER_BUILDER
-
NOOP_LONG_UP_DOWN_COUNTER_BUILDER
-
NOOP_DOUBLE_HISTOGRAM_BUILDER
-
NOOP_DOUBLE_GAUGE_BUILDER
-
NOOP_BATCH_CALLBACK
-
NOOP_OBSERVABLE_DOUBLE_MEASUREMENT
-
NOOP_OBSERVABLE_LONG_MEASUREMENT
-
-
Constructor Details
-
ExtendedDefaultMeter
private ExtendedDefaultMeter()
-
-
Method Details
-
getNoop
-
counterBuilder
Description copied from interface:MeterConstructs a Counter instrument.This is used to build both synchronous instruments and asynchronous instruments (i.e. callbacks).
- Specified by:
counterBuilderin interfaceMeter- 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
Description copied from interface:MeterConstructs an UpDownCounter instrument.This is used to build both synchronous instruments and asynchronous instruments (i.e. callbacks).
- Specified by:
upDownCounterBuilderin interfaceMeter- 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
Description copied from interface:MeterConstructs a Histogram instrument.- Specified by:
histogramBuilderin interfaceMeter- 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
Description copied from interface:MeterConstructs an Asynchronous Gauge instrument.- Specified by:
gaugeBuilderin interfaceMeter- 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:MeterConstructs 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.
observableMeasurementandadditionalMeasurements
- Specified by:
batchCallbackin interfaceMeter- 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.
-