Interface Aggregator<T extends PointData,​U extends ExemplarData>

    • Method Detail

      • 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 previousCumulativeReusable

        Aggregators 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)
        Resets reusablePoint to represent the measurement.

        Aggregators MUST implement diff if it can be used with asynchronous instruments.

      • createReusablePoint

        default T createReusablePoint()
        Creates a new reusable point.
      • copyPoint

        default void copyPoint​(T point,
                               T toReusablePoint)
        Copies point into toReusablePoint.
      • toMetricData

        MetricData toMetricData​(Resource resource,
                                InstrumentationScopeInfo instrumentationScopeInfo,
                                MetricDescriptor metricDescriptor,
                                java.util.Collection<T> points,
                                AggregationTemporality temporality)
        Returns the MetricData that this Aggregation will 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 points
        temporality - the temporality of the metric.
        Returns:
        the MetricDataType that this Aggregation will produce.