Class DoubleSumAggregator
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.internal.aggregator.AbstractSumAggregator<DoublePointData,DoubleExemplarData>
-
- io.opentelemetry.sdk.metrics.internal.aggregator.DoubleSumAggregator
-
- All Implemented Interfaces:
Aggregator<DoublePointData,DoubleExemplarData>
public final class DoubleSumAggregator extends AbstractSumAggregator<DoublePointData,DoubleExemplarData>
Sum aggregator that keeps values asdoubles.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 classDoubleSumAggregator.Handle
-
Field Summary
Fields Modifier and Type Field Description private MemoryModememoryModeprivate java.util.function.Supplier<ExemplarReservoir<DoubleExemplarData>>reservoirSupplier
-
Constructor Summary
Constructors Constructor Description DoubleSumAggregator(InstrumentDescriptor instrumentDescriptor, java.util.function.Supplier<ExemplarReservoir<DoubleExemplarData>> reservoirSupplier, MemoryMode memoryMode)Constructs a sum aggregator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyPoint(DoublePointData point, DoublePointData toReusablePoint)CopiespointintotoReusablePoint.AggregatorHandle<DoublePointData,DoubleExemplarData>createHandle()Returns a newAggregatorHandle.DoublePointDatacreateReusablePoint()Creates a new reusable point.DoublePointDatadiff(DoublePointData previousPoint, DoublePointData currentPoint)Returns a new DELTA point by computing the difference between two cumulative points.voiddiffInPlace(DoublePointData previousReusablePoint, DoublePointData currentPoint)Resets one reusable point to be a DELTA point by computing the difference between two cumulative points.MetricDatatoMetricData(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, MetricDescriptor descriptor, java.util.Collection<DoublePointData> points, AggregationTemporality temporality)Returns theMetricDatathat thisAggregationwill produce.DoublePointDatatoPoint(Measurement measurement)Return a new point representing the measurement.voidtoPoint(Measurement measurement, DoublePointData reusablePoint)ResetsreusablePointto represent themeasurement.-
Methods inherited from class io.opentelemetry.sdk.metrics.internal.aggregator.AbstractSumAggregator
isMonotonic
-
-
-
-
Field Detail
-
reservoirSupplier
private final java.util.function.Supplier<ExemplarReservoir<DoubleExemplarData>> reservoirSupplier
-
memoryMode
private final MemoryMode memoryMode
-
-
Constructor Detail
-
DoubleSumAggregator
public DoubleSumAggregator(InstrumentDescriptor instrumentDescriptor, java.util.function.Supplier<ExemplarReservoir<DoubleExemplarData>> reservoirSupplier, MemoryMode memoryMode)
Constructs a sum aggregator.- Parameters:
instrumentDescriptor- The instrument being recorded, used to compute monotonicity.reservoirSupplier- Supplier of exemplar reservoirs per-stream.memoryMode- The memory mode to use.
-
-
Method Detail
-
createHandle
public AggregatorHandle<DoublePointData,DoubleExemplarData> createHandle()
Description copied from interface:AggregatorReturns a newAggregatorHandle. This MUST by used by the synchronous to aggregate recorded measurements during the collection cycle.- Returns:
- a new
AggregatorHandle.
-
diff
public DoublePointData diff(DoublePointData previousPoint, DoublePointData currentPoint)
Description copied from interface:AggregatorReturns 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(DoublePointData previousReusablePoint, DoublePointData currentPoint)
Description copied from interface:AggregatorResets 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
previousCumulativeReusableAggregators 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 DoublePointData toPoint(Measurement measurement)
Description copied from interface:AggregatorReturn a new point representing the measurement.Aggregators MUST implement diff if it can be used with asynchronous instruments.
-
toPoint
public void toPoint(Measurement measurement, DoublePointData reusablePoint)
Description copied from interface:AggregatorResetsreusablePointto represent themeasurement.Aggregators MUST implement diff if it can be used with asynchronous instruments.
-
createReusablePoint
public DoublePointData createReusablePoint()
Description copied from interface:AggregatorCreates a new reusable point.
-
copyPoint
public void copyPoint(DoublePointData point, DoublePointData toReusablePoint)
Description copied from interface:AggregatorCopiespointintotoReusablePoint.
-
toMetricData
public MetricData toMetricData(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, MetricDescriptor descriptor, java.util.Collection<DoublePointData> points, AggregationTemporality temporality)
Description copied from interface:AggregatorReturns theMetricDatathat thisAggregationwill 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
MetricDataTypethat thisAggregationwill produce.
-
-