Package io.opentelemetry.api.metrics
Interface BatchRecorder
-
@ThreadSafe public interface BatchRecorderUtil 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 BatchRecorderput(DoubleCounter counter, double value)Associates theDoubleCounterwith the given value.BatchRecorderput(DoubleUpDownCounter upDownCounter, double value)Associates theDoubleUpDownCounterwith the given value.BatchRecorderput(DoubleValueRecorder valueRecorder, double value)Associates theDoubleValueRecorderwith the given value.BatchRecorderput(LongCounter counter, long value)Associates theLongCounterwith the given value.BatchRecorderput(LongUpDownCounter upDownCounter, long value)Associates theLongUpDownCounterwith the given value.BatchRecorderput(LongValueRecorder valueRecorder, long value)Associates theLongValueRecorderwith the given value.voidrecord()Records all of measurements at the same time.
-
-
-
Method Detail
-
put
BatchRecorder put(LongValueRecorder valueRecorder, long value)
Associates theLongValueRecorderwith the given value. Subsequent updates to the sameLongValueRecorderwill overwrite the previous value.- Parameters:
valueRecorder- theLongValueRecorder.value- the value to be associated withvalueRecorder.- Returns:
- this.
-
put
BatchRecorder put(DoubleValueRecorder valueRecorder, double value)
Associates theDoubleValueRecorderwith the given value. Subsequent updates to the sameDoubleValueRecorderwill overwrite the previous value.- Parameters:
valueRecorder- theDoubleValueRecorder.value- the value to be associated withvalueRecorder.- Returns:
- this.
-
put
BatchRecorder put(LongCounter counter, long value)
Associates theLongCounterwith the given value. Subsequent updates to the sameLongCounterwill overwrite the previous value.- Parameters:
counter- theLongCounter.value- the value to be associated withcounter.- Returns:
- this.
-
put
BatchRecorder put(DoubleCounter counter, double value)
Associates theDoubleCounterwith the given value. Subsequent updates to the sameDoubleCounterwill overwrite the previous value.- Parameters:
counter- theDoubleCounter.value- the value to be associated withcounter.- Returns:
- this.
-
put
BatchRecorder put(LongUpDownCounter upDownCounter, long value)
Associates theLongUpDownCounterwith the given value. Subsequent updates to the sameLongCounterwill overwrite the previous value.- Parameters:
upDownCounter- theLongCounter.value- the value to be associated withcounter.- Returns:
- this.
-
put
BatchRecorder put(DoubleUpDownCounter upDownCounter, double value)
Associates theDoubleUpDownCounterwith the given value. Subsequent updates to the sameDoubleCounterwill 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.
-
-