Package io.opentelemetry.api.metrics
Class DefaultMeter.NoopLongCounterBuilder
java.lang.Object
io.opentelemetry.api.metrics.DefaultMeter.NoopLongCounterBuilder
- All Implemented Interfaces:
LongCounterBuilder
- Enclosing class:
DefaultMeter
private static class DefaultMeter.NoopLongCounterBuilder
extends Object
implements LongCounterBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final LongCounter
private static final DoubleCounterBuilder
private static final ObservableLongCounter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds and returns a Counter instrument with the configuration.Build an observer for this instrument to observe values from aBatchCallback
.buildWithCallback
(Consumer<ObservableLongMeasurement> callback) Builds an Asynchronous Counter instrument with the given callback.Sets the Counter for recordingdouble
values.setDescription
(String description) Sets the description for this instrument.Sets the unit of measure for this instrument.
-
Field Details
-
NOOP_COUNTER
-
NOOP_OBSERVABLE_COUNTER
-
NOOP_DOUBLE_COUNTER_BUILDER
-
-
Constructor Details
-
NoopLongCounterBuilder
private NoopLongCounterBuilder()
-
-
Method Details
-
setDescription
Description copied from interface:LongCounterBuilder
Sets the description for this instrument.- Specified by:
setDescription
in interfaceLongCounterBuilder
- Parameters:
description
- The description.- See Also:
-
setUnit
Description copied from interface:LongCounterBuilder
Sets the unit of measure for this instrument.- Specified by:
setUnit
in interfaceLongCounterBuilder
- Parameters:
unit
- The unit. Instrument units must be 63 or fewer ASCII characters.- See Also:
-
ofDoubles
Description copied from interface:LongCounterBuilder
Sets the Counter for recordingdouble
values.- Specified by:
ofDoubles
in interfaceLongCounterBuilder
-
build
Description copied from interface:LongCounterBuilder
Builds and returns a Counter instrument with the configuration.- Specified by:
build
in interfaceLongCounterBuilder
- Returns:
- The Counter instrument.
-
buildWithCallback
Description copied from interface:LongCounterBuilder
Builds an Asynchronous Counter instrument with the given callback.The callback will be called when the instrument is 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.
- Specified by:
buildWithCallback
in interfaceLongCounterBuilder
- Parameters:
callback
- A callback which observes measurements when invoked.
-
buildObserver
Description copied from interface:LongCounterBuilder
Build an observer for this instrument to observe values from aBatchCallback
.This observer MUST be registered when creating a
batchCallback
, which records to it. Values observed outside registered callbacks are ignored.- Specified by:
buildObserver
in interfaceLongCounterBuilder
- Returns:
- an observable measurement that batch callbacks use to observe values.
-