Class LongSumAggregator
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.internal.aggregator.AbstractSumAggregator<LongPointData,LongExemplarData>
-
- io.opentelemetry.sdk.metrics.internal.aggregator.LongSumAggregator
-
- All Implemented Interfaces:
Aggregator<LongPointData,LongExemplarData>
public final class LongSumAggregator extends AbstractSumAggregator<LongPointData,LongExemplarData>
Sum aggregator that keeps values aslong
s.This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
LongSumAggregator.Handle
-
Field Summary
Fields Modifier and Type Field Description private MemoryMode
memoryMode
private java.util.function.Supplier<ExemplarReservoir<LongExemplarData>>
reservoirSupplier
-
Constructor Summary
Constructors Constructor Description LongSumAggregator(InstrumentDescriptor instrumentDescriptor, java.util.function.Supplier<ExemplarReservoir<LongExemplarData>> reservoirSupplier, MemoryMode memoryMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyPoint(LongPointData point, LongPointData toReusablePoint)
Copiespoint
intotoReusablePoint
.AggregatorHandle<LongPointData,LongExemplarData>
createHandle()
Returns a newAggregatorHandle
.LongPointData
createReusablePoint()
Creates a new reusable point.LongPointData
diff(LongPointData previousPoint, LongPointData currentPoint)
Returns a new DELTA point by computing the difference between two cumulative points.void
diffInPlace(LongPointData previousReusablePoint, LongPointData currentPoint)
Resets one reusable point to be a DELTA point by computing the difference between two cumulative points.MetricData
toMetricData(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, MetricDescriptor descriptor, java.util.Collection<LongPointData> points, AggregationTemporality temporality)
Returns theMetricData
that thisAggregation
will produce.LongPointData
toPoint(Measurement measurement)
Return a new point representing the measurement.void
toPoint(Measurement measurement, LongPointData reusablePoint)
ResetsreusablePoint
to represent themeasurement
.-
Methods inherited from class io.opentelemetry.sdk.metrics.internal.aggregator.AbstractSumAggregator
isMonotonic
-
-
-
-
Field Detail
-
reservoirSupplier
private final java.util.function.Supplier<ExemplarReservoir<LongExemplarData>> reservoirSupplier
-
memoryMode
private final MemoryMode memoryMode
-
-
Constructor Detail
-
LongSumAggregator
public LongSumAggregator(InstrumentDescriptor instrumentDescriptor, java.util.function.Supplier<ExemplarReservoir<LongExemplarData>> reservoirSupplier, MemoryMode memoryMode)
-
-
Method Detail
-
createHandle
public AggregatorHandle<LongPointData,LongExemplarData> createHandle()
Description copied from interface:Aggregator
Returns a newAggregatorHandle
. This MUST by used by the synchronous to aggregate recorded measurements during the collection cycle.- Returns:
- a new
AggregatorHandle
.
-
diff
public LongPointData diff(LongPointData previousPoint, LongPointData currentPoint)
Description copied from interface:Aggregator
Returns a new DELTA point by computing the difference between two cumulative points.Aggregators MUST implement diff if it can be used with asynchronous instruments.
- Parameters:
previousPoint
- the previously captured point.currentPoint
- the newly captured (cumulative) point.- Returns:
- The resulting delta point.
-
diffInPlace
public void diffInPlace(LongPointData previousReusablePoint, LongPointData currentPoint)
Description copied from interface:Aggregator
Resets one reusable point to be a DELTA point by computing the difference between two cumulative points.The delta between the two points is set on
previousCumulativeReusable
Aggregators MUST implement diff if it can be used with asynchronous instruments.
- Parameters:
previousReusablePoint
- the previously captured point.currentPoint
- the newly captured (cumulative) point.
-
toPoint
public LongPointData toPoint(Measurement measurement)
Description copied from interface:Aggregator
Return a new point representing the measurement.Aggregators MUST implement diff if it can be used with asynchronous instruments.
-
toPoint
public void toPoint(Measurement measurement, LongPointData reusablePoint)
Description copied from interface:Aggregator
ResetsreusablePoint
to represent themeasurement
.Aggregators MUST implement diff if it can be used with asynchronous instruments.
-
createReusablePoint
public LongPointData createReusablePoint()
Description copied from interface:Aggregator
Creates a new reusable point.
-
copyPoint
public void copyPoint(LongPointData point, LongPointData toReusablePoint)
Description copied from interface:Aggregator
Copiespoint
intotoReusablePoint
.
-
toMetricData
public MetricData toMetricData(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, MetricDescriptor descriptor, java.util.Collection<LongPointData> points, AggregationTemporality temporality)
Description copied from interface:Aggregator
Returns theMetricData
that thisAggregation
will produce.- Parameters:
resource
- the resource producing the metric.instrumentationScopeInfo
- the scope that instrumented the metric.descriptor
- the name, description and unit of the metric.points
- list of pointstemporality
- the temporality of the metric.- Returns:
- the
MetricDataType
that thisAggregation
will produce.
-
-