Package io.opentelemetry.api.metrics
Class DefaultMeter.NoopLongUpDownCounterBuilder
- java.lang.Object
-
- io.opentelemetry.api.metrics.DefaultMeter.NoopLongUpDownCounterBuilder
-
- All Implemented Interfaces:
LongUpDownCounterBuilder
- Enclosing class:
- DefaultMeter
private static class DefaultMeter.NoopLongUpDownCounterBuilder extends java.lang.Object implements LongUpDownCounterBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private static DoubleUpDownCounterBuilder
NOOP_DOUBLE_UP_DOWN_COUNTER_BUILDER
private static ObservableLongUpDownCounter
NOOP_OBSERVABLE_UP_DOWN_COUNTER
private static LongUpDownCounter
NOOP_UP_DOWN_COUNTER
-
Constructor Summary
Constructors Modifier Constructor Description private
NoopLongUpDownCounterBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LongUpDownCounter
build()
Builds and returns an UpDownCounter instrument with the configuration.ObservableLongMeasurement
buildObserver()
Build an observer for this instrument to observe values from aBatchCallback
.ObservableLongUpDownCounter
buildWithCallback(java.util.function.Consumer<ObservableLongMeasurement> callback)
Builds an Asynchronous UpDownCounter instrument with the given callback.DoubleUpDownCounterBuilder
ofDoubles()
Sets the Counter for recordingdouble
values.LongUpDownCounterBuilder
setDescription(java.lang.String description)
Sets the description for this instrument.LongUpDownCounterBuilder
setUnit(java.lang.String unit)
Sets the unit of measure for this instrument.
-
-
-
Field Detail
-
NOOP_UP_DOWN_COUNTER
private static final LongUpDownCounter NOOP_UP_DOWN_COUNTER
-
NOOP_OBSERVABLE_UP_DOWN_COUNTER
private static final ObservableLongUpDownCounter NOOP_OBSERVABLE_UP_DOWN_COUNTER
-
NOOP_DOUBLE_UP_DOWN_COUNTER_BUILDER
private static final DoubleUpDownCounterBuilder NOOP_DOUBLE_UP_DOWN_COUNTER_BUILDER
-
-
Method Detail
-
setDescription
public LongUpDownCounterBuilder setDescription(java.lang.String description)
Description copied from interface:LongUpDownCounterBuilder
Sets the description for this instrument.- Specified by:
setDescription
in interfaceLongUpDownCounterBuilder
- Parameters:
description
- The description.- See Also:
- Instrument Description
-
setUnit
public LongUpDownCounterBuilder setUnit(java.lang.String unit)
Description copied from interface:LongUpDownCounterBuilder
Sets the unit of measure for this instrument.- Specified by:
setUnit
in interfaceLongUpDownCounterBuilder
- Parameters:
unit
- The unit. Instrument units must be 63 or fewer ASCII characters.- See Also:
- Instrument Unit
-
ofDoubles
public DoubleUpDownCounterBuilder ofDoubles()
Description copied from interface:LongUpDownCounterBuilder
Sets the Counter for recordingdouble
values.- Specified by:
ofDoubles
in interfaceLongUpDownCounterBuilder
-
build
public LongUpDownCounter build()
Description copied from interface:LongUpDownCounterBuilder
Builds and returns an UpDownCounter instrument with the configuration.- Specified by:
build
in interfaceLongUpDownCounterBuilder
- Returns:
- The UpDownCounter instrument.
-
buildWithCallback
public ObservableLongUpDownCounter buildWithCallback(java.util.function.Consumer<ObservableLongMeasurement> callback)
Description copied from interface:LongUpDownCounterBuilder
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 interfaceLongUpDownCounterBuilder
- Parameters:
callback
- A callback which observes measurements when invoked.
-
buildObserver
public ObservableLongMeasurement buildObserver()
Description copied from interface:LongUpDownCounterBuilder
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 interfaceLongUpDownCounterBuilder
- Returns:
- an observable measurement that batch callbacks use to observe values.
-
-