Package io.opentelemetry.api.metrics
Interface AsynchronousInstrumentBuilder<R>
-
- All Superinterfaces:
InstrumentBuilder
- All Known Subinterfaces:
DoubleSumObserverBuilder
,DoubleUpDownSumObserverBuilder
,DoubleValueObserverBuilder
,LongSumObserverBuilder
,LongUpDownSumObserverBuilder
,LongValueObserverBuilder
public interface AsynchronousInstrumentBuilder<R> extends InstrumentBuilder
Builder class forAsynchronousInstrument
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AsynchronousInstrument
build()
Builds and returns aInstrument
with the desired options.AsynchronousInstrumentBuilder<R>
setUpdater(Consumer<R> updater)
Sets a consumer that gets executed every collection interval.-
Methods inherited from interface io.opentelemetry.api.metrics.InstrumentBuilder
setDescription, setUnit
-
-
-
-
Method Detail
-
setUpdater
AsynchronousInstrumentBuilder<R> setUpdater(Consumer<R> updater)
Sets a consumer that gets executed every collection interval.Evaluation is deferred until needed, if this
AsynchronousInstrument
metric is not exported then it will never be called.- Parameters:
updater
- the consumer to be executed before export.
-
build
AsynchronousInstrument build()
Description copied from interface:InstrumentBuilder
Builds and returns aInstrument
with the desired options.- Specified by:
build
in interfaceInstrumentBuilder
- Returns:
- a
Instrument
with the desired options.
-
-