Class ExtendedDefaultMeter.NoopDoubleCounterBuilder
java.lang.Object
io.opentelemetry.api.incubator.metrics.ExtendedDefaultMeter.NoopDoubleCounterBuilder
- All Implemented Interfaces:
ExtendedDoubleCounterBuilder, DoubleCounterBuilder
- Enclosing class:
ExtendedDefaultMeter
private static class ExtendedDefaultMeter.NoopDoubleCounterBuilder
extends Object
implements ExtendedDoubleCounterBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DoubleCounterprivate static final ObservableDoubleCounter -
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<ObservableDoubleMeasurement> callback) Builds an Asynchronous Counter instrument with the given callback.setDescription(String description) Sets the description for this instrument.Sets the unit of measure for this instrument.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ExtendedDoubleCounterBuilder
setAttributesAdvice
-
Field Details
-
NOOP_COUNTER
-
NOOP_OBSERVABLE_COUNTER
-
-
Constructor Details
-
NoopDoubleCounterBuilder
private NoopDoubleCounterBuilder()
-
-
Method Details
-
setDescription
Description copied from interface:DoubleCounterBuilderSets the description for this instrument.- Specified by:
setDescriptionin interfaceDoubleCounterBuilder- Parameters:
description- The description.- See Also:
-
setUnit
Description copied from interface:DoubleCounterBuilderSets the unit of measure for this instrument.- Specified by:
setUnitin interfaceDoubleCounterBuilder- Parameters:
unit- The unit. Instrument units must be 63 or fewer ASCII characters.- See Also:
-
build
Description copied from interface:DoubleCounterBuilderBuilds and returns a Counter instrument with the configuration.- Specified by:
buildin interfaceDoubleCounterBuilder- Returns:
- The Counter instrument.
-
buildWithCallback
Description copied from interface:DoubleCounterBuilderBuilds 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:
buildWithCallbackin interfaceDoubleCounterBuilder- Parameters:
callback- A callback which observes measurements when invoked.
-
buildObserver
Description copied from interface:DoubleCounterBuilderBuild 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:
buildObserverin interfaceDoubleCounterBuilder- Returns:
- an observable measurement that batch callbacks use to observe values.
-