1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
5 #ifndef ENABLE_METRICS_PREVIEW
6 # include "opentelemetry/nostd/string_view.h"
7 # include "opentelemetry/sdk/metrics/data/metric_data.h"
8 # include "opentelemetry/sdk/metrics/data/point_data.h"
9 OPENTELEMETRY_BEGIN_NAMESPACE
17 virtual void Aggregate(long value
, const PointAttributes
&attributes
= {}) noexcept
= 0;
19 virtual void Aggregate(double value
, const PointAttributes
&attributes
= {}) noexcept
= 0;
22 * Returns the result of the merge of the two aggregations.
24 * This should always assume that the aggregations do not overlap and merge together for a new
27 * @param delta the newly captured (delta) aggregation
28 * @return the result of the merge of the given aggregation.
31 virtual std::unique_ptr
<Aggregation
> Merge(const Aggregation
&delta
) const noexcept
= 0;
34 * Returns a new delta aggregation by comparing two cumulative measurements.
36 * @param next the newly captured (cumulative) aggregation.
37 * @return The resulting delta aggregation.
39 virtual std::unique_ptr
<Aggregation
> Diff(const Aggregation
&next
) const noexcept
= 0;
42 * Returns the point data that the aggregation will produce.
47 virtual PointType
ToPoint() const noexcept
= 0;
49 virtual ~Aggregation() = default;
52 } // namespace metrics
54 OPENTELEMETRY_END_NAMESPACE