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 java.lang.Object implements ExtendedDoubleCounterBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private static DoubleCounter
NOOP_COUNTER
private static ObservableDoubleCounter
NOOP_OBSERVABLE_COUNTER
-
Constructor Summary
Constructors Modifier Constructor Description private
NoopDoubleCounterBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleCounter
build()
Builds and returns a Counter instrument with the configuration.ObservableDoubleMeasurement
buildObserver()
Build an observer for this instrument to observe values from aBatchCallback
.ObservableDoubleCounter
buildWithCallback(java.util.function.Consumer<ObservableDoubleMeasurement> callback)
Builds an Asynchronous Counter instrument with the given callback.DoubleCounterBuilder
setDescription(java.lang.String description)
Sets the description for this instrument.DoubleCounterBuilder
setUnit(java.lang.String unit)
Sets the unit of measure for this instrument.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.opentelemetry.api.incubator.metrics.ExtendedDoubleCounterBuilder
setAttributesAdvice
-
-
-
-
Field Detail
-
NOOP_COUNTER
private static final DoubleCounter NOOP_COUNTER
-
NOOP_OBSERVABLE_COUNTER
private static final ObservableDoubleCounter NOOP_OBSERVABLE_COUNTER
-
-
Method Detail
-
setDescription
public DoubleCounterBuilder setDescription(java.lang.String description)
Description copied from interface:DoubleCounterBuilder
Sets the description for this instrument.- Specified by:
setDescription
in interfaceDoubleCounterBuilder
- Parameters:
description
- The description.- See Also:
- Instrument Description
-
setUnit
public DoubleCounterBuilder setUnit(java.lang.String unit)
Description copied from interface:DoubleCounterBuilder
Sets the unit of measure for this instrument.- Specified by:
setUnit
in interfaceDoubleCounterBuilder
- Parameters:
unit
- The unit. Instrument units must be 63 or fewer ASCII characters.- See Also:
- Instrument Unit
-
build
public DoubleCounter build()
Description copied from interface:DoubleCounterBuilder
Builds and returns a Counter instrument with the configuration.- Specified by:
build
in interfaceDoubleCounterBuilder
- Returns:
- The Counter instrument.
-
buildWithCallback
public ObservableDoubleCounter buildWithCallback(java.util.function.Consumer<ObservableDoubleMeasurement> callback)
Description copied from interface:DoubleCounterBuilder
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 interfaceDoubleCounterBuilder
- Parameters:
callback
- A callback which observes measurements when invoked.
-
buildObserver
public ObservableDoubleMeasurement buildObserver()
Description copied from interface:DoubleCounterBuilder
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 interfaceDoubleCounterBuilder
- Returns:
- an observable measurement that batch callbacks use to observe values.
-
-