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 as
double
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MemoryMode
private final Supplier
<ExemplarReservoir<DoubleExemplarData>> -
Constructor Summary
ConstructorsConstructorDescriptionDoubleSumAggregator
(InstrumentDescriptor instrumentDescriptor, Supplier<ExemplarReservoir<DoubleExemplarData>> reservoirSupplier, MemoryMode memoryMode) Constructs a sum aggregator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
copyPoint
(DoublePointData point, DoublePointData toReusablePoint) Copiespoint
intotoReusablePoint
.Returns a newAggregatorHandle
.Creates a new reusable point.diff
(DoublePointData previousPoint, DoublePointData currentPoint) Returns a new DELTA point by computing the difference between two cumulative points.void
diffInPlace
(DoublePointData previousReusablePoint, DoublePointData currentPoint) Resets one reusable point to be a DELTA point by computing the difference between two cumulative points.toMetricData
(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, MetricDescriptor descriptor, Collection<DoublePointData> points, AggregationTemporality temporality) Returns theMetricData
that thisAggregation
will produce.toPoint
(Measurement measurement) Return a new point representing the measurement.void
toPoint
(Measurement measurement, DoublePointData reusablePoint) ResetsreusablePoint
to represent themeasurement
.Methods inherited from class io.opentelemetry.sdk.metrics.internal.aggregator.AbstractSumAggregator
isMonotonic
-
Field Details
-
reservoirSupplier
-
memoryMode
-
-
Constructor Details
-
DoubleSumAggregator
public DoubleSumAggregator(InstrumentDescriptor instrumentDescriptor, 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 Details
-
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
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
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
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
Description copied from interface:Aggregator
ResetsreusablePoint
to represent themeasurement
.Aggregators MUST implement diff if it can be used with asynchronous instruments.
-
createReusablePoint
Description copied from interface:Aggregator
Creates a new reusable point. -
copyPoint
Description copied from interface:Aggregator
Copiespoint
intotoReusablePoint
. -
toMetricData
public MetricData toMetricData(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, MetricDescriptor descriptor, Collection<DoublePointData> 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.
-