Package io.opentelemetry.api.metrics
Interface DoubleSumObserver.Builder
-
- All Superinterfaces:
AsynchronousInstrument.Builder<AsynchronousInstrument.DoubleResult>,Instrument.Builder
- Enclosing interface:
- DoubleSumObserver
public static interface DoubleSumObserver.Builder extends AsynchronousInstrument.Builder<AsynchronousInstrument.DoubleResult>
Builder class forDoubleSumObserver.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DoubleSumObserverbuild()Builds and returns aInstrumentwith the desired options.DoubleSumObserver.BuildersetCallback(AsynchronousInstrument.Callback<AsynchronousInstrument.DoubleResult> callback)Sets a callback that gets executed every collection interval.DoubleSumObserver.BuildersetDescription(java.lang.String description)Sets the description of theInstrument.DoubleSumObserver.BuildersetUnit(java.lang.String unit)Sets the unit of theInstrument.
-
-
-
Method Detail
-
setDescription
DoubleSumObserver.Builder setDescription(java.lang.String description)
Description copied from interface:Instrument.BuilderSets the description of theInstrument.Default value is
"".- Specified by:
setDescriptionin interfaceInstrument.Builder- Parameters:
description- the description of the Instrument.- Returns:
- this.
-
setUnit
DoubleSumObserver.Builder setUnit(java.lang.String unit)
Description copied from interface:Instrument.BuilderSets the unit of theInstrument.Default value is
"1".- Specified by:
setUnitin interfaceInstrument.Builder- Parameters:
unit- the unit of the Instrument.- Returns:
- this.
-
setCallback
DoubleSumObserver.Builder setCallback(AsynchronousInstrument.Callback<AsynchronousInstrument.DoubleResult> callback)
Description copied from interface:AsynchronousInstrument.BuilderSets a callback that gets executed every collection interval.Evaluation is deferred until needed, if this
AsynchronousInstrumentmetric is not exported then it will never be called.- Specified by:
setCallbackin interfaceAsynchronousInstrument.Builder<AsynchronousInstrument.DoubleResult>- Parameters:
callback- the callback to be executed before export.
-
build
DoubleSumObserver build()
Description copied from interface:Instrument.BuilderBuilds and returns aInstrumentwith the desired options.- Specified by:
buildin interfaceAsynchronousInstrument.Builder<AsynchronousInstrument.DoubleResult>- Specified by:
buildin interfaceInstrument.Builder- Returns:
- a
Instrumentwith the desired options.
-
-