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 class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Meter
private static final BatchCallback
private static final DoubleGaugeBuilder
private static final DoubleHistogramBuilder
private static final LongCounterBuilder
private static final LongUpDownCounterBuilder
private static final ObservableDoubleMeasurement
private 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 Meter
getNoop()
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:Meter
Constructs a Counter instrument.This is used to build both synchronous instruments and asynchronous instruments (i.e. callbacks).
- Specified by:
counterBuilder
in 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:Meter
Constructs an UpDownCounter instrument.This is used to build both synchronous instruments and asynchronous instruments (i.e. callbacks).
- Specified by:
upDownCounterBuilder
in 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:Meter
Constructs a Histogram instrument.- Specified by:
histogramBuilder
in 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:Meter
Constructs an Asynchronous Gauge instrument.- Specified by:
gaugeBuilder
in 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: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
andadditionalMeasurements
- Specified by:
batchCallback
in 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.
-