R
- the callback Result type.@ThreadSafe public interface AsynchronousInstrument<R extends AsynchronousInstrument.Result> extends Instrument
AsynchronousInstrument
is an interface that defines a type of instruments that are used
to report measurements asynchronously.
They are reported by a callback, once per collection interval, and lack Context. They are permitted to report only one value per distinct label set per period. If the application observes multiple values for the same label set, in a single callback, the last value is the only value kept.
Modifier and Type | Interface and Description |
---|---|
static interface |
AsynchronousInstrument.Builder
Builder class for
AsynchronousInstrument . |
static interface |
AsynchronousInstrument.Callback<R extends AsynchronousInstrument.Result>
A
Callback for a AsynchronousInstrument . |
static interface |
AsynchronousInstrument.DoubleResult
The result for the
AsynchronousInstrument.Callback . |
static interface |
AsynchronousInstrument.LongResult
The result for the
AsynchronousInstrument.Callback . |
static interface |
AsynchronousInstrument.Result |
Modifier and Type | Method and Description |
---|---|
void |
setCallback(AsynchronousInstrument.Callback<R> callback)
Sets a callback that gets executed every collection interval.
|
void setCallback(AsynchronousInstrument.Callback<R> callback)
Evaluation is deferred until needed, if this AsynchronousInstrument
metric is not
exported then it will never be called.
callback
- the callback to be executed before export.