Package io.opentelemetry.api.metrics
Interface BatchRecorder
-
@ThreadSafe public interface BatchRecorder
Util class that can be use to atomically record measurements associated with a set of Metrics.This class is equivalent with individually calling record on every Measure, but has the advantage that all these operations are recorded atomically and it is more efficient.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BatchRecorder
put(DoubleCounter counter, double value)
Associates theDoubleCounter
with the given value.BatchRecorder
put(DoubleUpDownCounter upDownCounter, double value)
Associates theDoubleUpDownCounter
with the given value.BatchRecorder
put(DoubleValueRecorder valueRecorder, double value)
Associates theDoubleValueRecorder
with the given value.BatchRecorder
put(LongCounter counter, long value)
Associates theLongCounter
with the given value.BatchRecorder
put(LongUpDownCounter upDownCounter, long value)
Associates theLongUpDownCounter
with the given value.BatchRecorder
put(LongValueRecorder valueRecorder, long value)
Associates theLongValueRecorder
with the given value.void
record()
Records all of measurements at the same time.
-
-
-
Method Detail
-
put
BatchRecorder put(LongValueRecorder valueRecorder, long value)
Associates theLongValueRecorder
with the given value. Subsequent updates to the sameLongValueRecorder
will overwrite the previous value.- Parameters:
valueRecorder
- theLongValueRecorder
.value
- the value to be associated withvalueRecorder
.- Returns:
- this.
-
put
BatchRecorder put(DoubleValueRecorder valueRecorder, double value)
Associates theDoubleValueRecorder
with the given value. Subsequent updates to the sameDoubleValueRecorder
will overwrite the previous value.- Parameters:
valueRecorder
- theDoubleValueRecorder
.value
- the value to be associated withvalueRecorder
.- Returns:
- this.
-
put
BatchRecorder put(LongCounter counter, long value)
Associates theLongCounter
with the given value. Subsequent updates to the sameLongCounter
will overwrite the previous value.- Parameters:
counter
- theLongCounter
.value
- the value to be associated withcounter
.- Returns:
- this.
-
put
BatchRecorder put(DoubleCounter counter, double value)
Associates theDoubleCounter
with the given value. Subsequent updates to the sameDoubleCounter
will overwrite the previous value.- Parameters:
counter
- theDoubleCounter
.value
- the value to be associated withcounter
.- Returns:
- this.
-
put
BatchRecorder put(LongUpDownCounter upDownCounter, long value)
Associates theLongUpDownCounter
with the given value. Subsequent updates to the sameLongCounter
will overwrite the previous value.- Parameters:
upDownCounter
- theLongCounter
.value
- the value to be associated withcounter
.- Returns:
- this.
-
put
BatchRecorder put(DoubleUpDownCounter upDownCounter, double value)
Associates theDoubleUpDownCounter
with the given value. Subsequent updates to the sameDoubleCounter
will overwrite the previous value.- Parameters:
upDownCounter
- theDoubleCounter
.value
- the value to be associated withcounter
.- Returns:
- this.
-
record
void record()
Records all of measurements at the same time.This method records all measurements every time it is called, so make sure it is not called twice if not needed.
-
-