Class DoubleLastValueAggregator
- All Implemented Interfaces:
Aggregator<DoublePointData, DoubleExemplarData>
Limitation: The current implementation does not store a time when the value was recorded, so merging multiple LastValueAggregators will not preserve the ordering of records. This is not a problem because LastValueAggregator is currently only available for Observers which record all values once.
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 ClassesModifier and TypeClassDescription(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MemoryModeprivate final Supplier<ExemplarReservoir<DoubleExemplarData>> -
Constructor Summary
ConstructorsConstructorDescriptionDoubleLastValueAggregator(Supplier<ExemplarReservoir<DoubleExemplarData>> reservoirSupplier, MemoryMode memoryMode) -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyPoint(DoublePointData point, DoublePointData toReusablePoint) CopiespointintotoReusablePoint.Returns a newAggregatorHandle.Creates a new reusable point.diff(DoublePointData previous, DoublePointData current) Returns a new DELTA point by computing the difference between two cumulative points.voiddiffInPlace(DoublePointData previousReusable, DoublePointData current) 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 theMetricDatathat thisAggregationwill produce.toPoint(Measurement measurement) Return a new point representing the measurement.voidtoPoint(Measurement measurement, DoublePointData reusablePoint) ResetsreusablePointto represent themeasurement.
-
Field Details
-
reservoirSupplier
-
memoryMode
-
-
Constructor Details
-
DoubleLastValueAggregator
public DoubleLastValueAggregator(Supplier<ExemplarReservoir<DoubleExemplarData>> reservoirSupplier, MemoryMode memoryMode)
-
-
Method Details
-
createHandle
Description copied from interface:AggregatorReturns a newAggregatorHandle. This MUST by used by the synchronous to aggregate recorded measurements during the collection cycle.- Specified by:
createHandlein interfaceAggregator<DoublePointData, DoubleExemplarData>- Returns:
- a new
AggregatorHandle.
-
diff
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.
- Specified by:
diffin interfaceAggregator<DoublePointData, DoubleExemplarData>- Parameters:
previous- the previously captured point.current- the newly captured (cumulative) point.- Returns:
- The resulting delta point.
-
diffInPlace
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.
- Specified by:
diffInPlacein interfaceAggregator<DoublePointData, DoubleExemplarData>- Parameters:
previousReusable- the previously captured point.current- the newly captured (cumulative) point.
-
toPoint
Description copied from interface:AggregatorReturn a new point representing the measurement.Aggregators MUST implement diff if it can be used with asynchronous instruments.
- Specified by:
toPointin interfaceAggregator<DoublePointData, DoubleExemplarData>
-
toPoint
Description copied from interface:AggregatorResetsreusablePointto represent themeasurement.Aggregators MUST implement diff if it can be used with asynchronous instruments.
- Specified by:
toPointin interfaceAggregator<DoublePointData, DoubleExemplarData>
-
createReusablePoint
Description copied from interface:AggregatorCreates a new reusable point.- Specified by:
createReusablePointin interfaceAggregator<DoublePointData, DoubleExemplarData>
-
copyPoint
Description copied from interface:AggregatorCopiespointintotoReusablePoint.- Specified by:
copyPointin interfaceAggregator<DoublePointData, DoubleExemplarData>
-
toMetricData
public MetricData toMetricData(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, MetricDescriptor descriptor, Collection<DoublePointData> points, AggregationTemporality temporality) Description copied from interface:AggregatorReturns theMetricDatathat thisAggregationwill produce.- Specified by:
toMetricDatain interfaceAggregator<DoublePointData, DoubleExemplarData>- 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.
-