Package io.opentelemetry.api.metrics
Class DefaultMeter.NoopDoubleUpDownCounterBuilder
java.lang.Object
io.opentelemetry.api.metrics.DefaultMeter.NoopDoubleUpDownCounterBuilder
- All Implemented Interfaces:
DoubleUpDownCounterBuilder
- Enclosing class:
DefaultMeter
private static class DefaultMeter.NoopDoubleUpDownCounterBuilder
extends Object
implements DoubleUpDownCounterBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ObservableDoubleUpDownCounter
private static final DoubleUpDownCounter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds and returns an UpDownCounter instrument with the configuration.Build an observer for this instrument to observe values from aBatchCallback
.buildWithCallback
(Consumer<ObservableDoubleMeasurement> callback) Builds an Asynchronous UpDownCounter instrument with the given callback.setDescription
(String description) Sets the description for this instrument.Sets the unit of measure for this instrument.
-
Field Details
-
NOOP_UP_DOWN_COUNTER
-
NOOP_OBSERVABLE_UP_DOWN_COUNTER
-
-
Constructor Details
-
NoopDoubleUpDownCounterBuilder
private NoopDoubleUpDownCounterBuilder()
-
-
Method Details
-
setDescription
Description copied from interface:DoubleUpDownCounterBuilder
Sets the description for this instrument.- Specified by:
setDescription
in interfaceDoubleUpDownCounterBuilder
- Parameters:
description
- The description.- See Also:
-
setUnit
Description copied from interface:DoubleUpDownCounterBuilder
Sets the unit of measure for this instrument.- Specified by:
setUnit
in interfaceDoubleUpDownCounterBuilder
- Parameters:
unit
- The unit. Instrument units must be 63 or fewer ASCII characters.- See Also:
-
build
Description copied from interface:DoubleUpDownCounterBuilder
Builds and returns an UpDownCounter instrument with the configuration.- Specified by:
build
in interfaceDoubleUpDownCounterBuilder
- Returns:
- The UpDownCounter instrument.
-
buildWithCallback
public ObservableDoubleUpDownCounter buildWithCallback(Consumer<ObservableDoubleMeasurement> callback) Description copied from interface:DoubleUpDownCounterBuilder
Builds an Asynchronous UpDownCounter 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 interfaceDoubleUpDownCounterBuilder
- Parameters:
callback
- A callback which observes measurements when invoked.
-
buildObserver
Description copied from interface:DoubleUpDownCounterBuilder
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 interfaceDoubleUpDownCounterBuilder
- Returns:
- an observable measurement that batch callbacks use to observe values.
-