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