Class ExtendedDefaultMeter.NoopDoubleUpDownCounterBuilder
- java.lang.Object
-
- io.opentelemetry.api.incubator.metrics.ExtendedDefaultMeter.NoopDoubleUpDownCounterBuilder
-
- All Implemented Interfaces:
ExtendedDoubleUpDownCounterBuilder
,DoubleUpDownCounterBuilder
- Enclosing class:
- ExtendedDefaultMeter
private static class ExtendedDefaultMeter.NoopDoubleUpDownCounterBuilder extends java.lang.Object implements ExtendedDoubleUpDownCounterBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private static ObservableDoubleUpDownCounter
NOOP_OBSERVABLE_UP_DOWN_COUNTER
private static DoubleUpDownCounter
NOOP_UP_DOWN_COUNTER
-
Constructor Summary
Constructors Modifier Constructor Description private
NoopDoubleUpDownCounterBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleUpDownCounter
build()
Builds and returns an UpDownCounter instrument with the configuration.ObservableDoubleMeasurement
buildObserver()
Build an observer for this instrument to observe values from aBatchCallback
.ObservableDoubleUpDownCounter
buildWithCallback(java.util.function.Consumer<ObservableDoubleMeasurement> callback)
Builds an Asynchronous UpDownCounter instrument with the given callback.DoubleUpDownCounterBuilder
setDescription(java.lang.String description)
Sets the description for this instrument.DoubleUpDownCounterBuilder
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.ExtendedDoubleUpDownCounterBuilder
setAttributesAdvice
-
-
-
-
Field Detail
-
NOOP_UP_DOWN_COUNTER
private static final DoubleUpDownCounter NOOP_UP_DOWN_COUNTER
-
NOOP_OBSERVABLE_UP_DOWN_COUNTER
private static final ObservableDoubleUpDownCounter NOOP_OBSERVABLE_UP_DOWN_COUNTER
-
-
Method Detail
-
setDescription
public DoubleUpDownCounterBuilder setDescription(java.lang.String description)
Description copied from interface:DoubleUpDownCounterBuilder
Sets the description for this instrument.- Specified by:
setDescription
in interfaceDoubleUpDownCounterBuilder
- Parameters:
description
- The description.- See Also:
- Instrument Description
-
setUnit
public DoubleUpDownCounterBuilder setUnit(java.lang.String unit)
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:
- Instrument Unit
-
build
public DoubleUpDownCounter 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(java.util.function.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
public ObservableDoubleMeasurement 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.
-
-