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