Interface Aggregator
-
- All Known Implementing Classes:
DoubleLastValueAggregator
,DoubleMinMaxSumCount
,DoubleSumAggregator
,LongLastValueAggregator
,LongMinMaxSumCount
,LongSumAggregator
,NoopAggregator
@ThreadSafe public interface Aggregator
Aggregator represents the interface for all the available aggregations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasRecordings()
Whether there have been any recordings since this aggregator has been reset.void
mergeToAndReset(Aggregator aggregator)
Merges the current value into the givenaggregator
and resets the current value in thisAggregator
.void
recordDouble(double value)
Updates the current aggregator with a newly recordeddouble
value.void
recordLong(long value)
Updates the current aggregator with a newly recordedlong
value.MetricData.Point
toPoint(long startEpochNanos, long epochNanos, io.opentelemetry.api.common.Labels labels)
Returns thePoint
with the given properties and the value from this Aggregation.
-
-
-
Method Detail
-
mergeToAndReset
void mergeToAndReset(Aggregator aggregator)
Merges the current value into the givenaggregator
and resets the current value in thisAggregator
.- Parameters:
aggregator
- value to merge into.
-
toPoint
@Nullable MetricData.Point toPoint(long startEpochNanos, long epochNanos, io.opentelemetry.api.common.Labels labels)
Returns thePoint
with the given properties and the value from this Aggregation.- Parameters:
startEpochNanos
- the startEpochNanos for thePoint
.epochNanos
- the epochNanos for thePoint
.labels
- the labels for thePoint
.- Returns:
- the
Point
with the value from this Aggregation.
-
recordLong
void recordLong(long value)
Updates the current aggregator with a newly recordedlong
value.- Parameters:
value
- the newlong
value to be added.
-
recordDouble
void recordDouble(double value)
Updates the current aggregator with a newly recordeddouble
value.- Parameters:
value
- the newdouble
value to be added.
-
hasRecordings
boolean hasRecordings()
Whether there have been any recordings since this aggregator has been reset.
-
-