Interface Aggregator<T extends PointData,U extends ExemplarData>
-
- All Known Implementing Classes:
AbstractSumAggregator,DoubleBase2ExponentialHistogramAggregator,DoubleExplicitBucketHistogramAggregator,DoubleLastValueAggregator,DoubleSumAggregator,DropAggregator,LongLastValueAggregator,LongSumAggregator
@Immutable public interface Aggregator<T extends PointData,U extends ExemplarData>Aggregator represents the abstract class for all the available aggregations that can be computed during the collection phase for all the instruments.This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcopyPoint(T point, T toReusablePoint)CopiespointintotoReusablePoint.AggregatorHandle<T,U>createHandle()Returns a newAggregatorHandle.default TcreateReusablePoint()Creates a new reusable point.default Tdiff(T previousCumulative, T currentCumulative)Returns a new DELTA point by computing the difference between two cumulative points.default voiddiffInPlace(T previousCumulativeReusable, T currentCumulative)Resets one reusable point to be a DELTA point by computing the difference between two cumulative points.static Aggregator<?,DoubleExemplarData>drop()Returns the drop aggregator, an aggregator that drops measurements.MetricDatatoMetricData(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, MetricDescriptor metricDescriptor, java.util.Collection<T> points, AggregationTemporality temporality)Returns theMetricDatathat thisAggregationwill produce.default TtoPoint(Measurement measurement)Return a new point representing the measurement.default voidtoPoint(Measurement measurement, T reusablePoint)ResetsreusablePointto represent themeasurement.
-
-
-
Method Detail
-
drop
static Aggregator<?,DoubleExemplarData> drop()
Returns the drop aggregator, an aggregator that drops measurements.
-
createHandle
AggregatorHandle<T,U> createHandle()
Returns a newAggregatorHandle. This MUST by used by the synchronous to aggregate recorded measurements during the collection cycle.- Returns:
- a new
AggregatorHandle.
-
diff
default T diff(T previousCumulative, T currentCumulative)
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:
previousCumulative- the previously captured point.currentCumulative- the newly captured (cumulative) point.- Returns:
- The resulting delta point.
-
diffInPlace
default void diffInPlace(T previousCumulativeReusable, T currentCumulative)
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
previousCumulativeReusableAggregators MUST implement diff if it can be used with asynchronous instruments.
- Parameters:
previousCumulativeReusable- the previously captured point.currentCumulative- the newly captured (cumulative) point.
-
toPoint
default T toPoint(Measurement measurement)
Return a new point representing the measurement.Aggregators MUST implement diff if it can be used with asynchronous instruments.
-
toPoint
default void toPoint(Measurement measurement, T reusablePoint)
ResetsreusablePointto represent themeasurement.Aggregators MUST implement diff if it can be used with asynchronous instruments.
-
createReusablePoint
default T createReusablePoint()
Creates a new reusable point.
-
toMetricData
MetricData toMetricData(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, MetricDescriptor metricDescriptor, java.util.Collection<T> points, AggregationTemporality temporality)
Returns theMetricDatathat thisAggregationwill produce.- Parameters:
resource- the resource producing the metric.instrumentationScopeInfo- the scope that instrumented the metric.metricDescriptor- the name, description and unit of the metric.points- list of pointstemporality- the temporality of the metric.- Returns:
- the
MetricDataTypethat thisAggregationwill produce.
-
-