NVIDIA DeepStream SDK API Reference

9.2 Release
includes/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h
Go to the documentation of this file.
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3 
4 #pragma once
5 
6 #include <stdint.h>
7 #include <memory>
8 
9 #include "opentelemetry/common/spin_lock_mutex.h"
10 #include "opentelemetry/sdk/metrics/aggregation/aggregation.h"
11 #include "opentelemetry/sdk/metrics/data/metric_data.h"
12 #include "opentelemetry/sdk/metrics/data/point_data.h"
13 #include "opentelemetry/version.h"
14 
16 namespace sdk
17 {
18 namespace metrics
19 {
20 
22 {
23 public:
24  LongSumAggregation(bool is_monotonic);
26 
27  void Aggregate(int64_t value, const PointAttributes &attributes = {}) noexcept override;
28 
29  void Aggregate(double /* value */, const PointAttributes & /* attributes */) noexcept override {}
30 
31  std::unique_ptr<Aggregation> Merge(const Aggregation &delta) const noexcept override;
32 
33  std::unique_ptr<Aggregation> Diff(const Aggregation &next) const noexcept override;
34 
35  PointType ToPoint() const noexcept override;
36 
37 private:
38  mutable opentelemetry::common::SpinLockMutex lock_;
39  SumPointData point_data_;
40 };
41 
43 {
44 public:
45  DoubleSumAggregation(bool is_monotonic);
47 
48  void Aggregate(int64_t /* value */, const PointAttributes & /* attributes */) noexcept override {}
49 
50  void Aggregate(double value, const PointAttributes &attributes = {}) noexcept override;
51 
52  std::unique_ptr<Aggregation> Merge(const Aggregation &delta) const noexcept override;
53 
54  std::unique_ptr<Aggregation> Diff(const Aggregation &next) const noexcept override;
55 
56  PointType ToPoint() const noexcept override;
57 
58 private:
59  mutable opentelemetry::common::SpinLockMutex lock_;
60  SumPointData point_data_;
61 };
62 
63 } // namespace metrics
64 } // namespace sdk
sdk::metrics::DoubleSumAggregation::Aggregate
void Aggregate(int64_t, const PointAttributes &) noexcept override
Definition: includes/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h:48
sdk::metrics::PointAttributes
opentelemetry::sdk::common::OrderedAttributeMap PointAttributes
Definition: includes/opentelemetry/sdk/metrics/data/metric_data.h:20
sdk::metrics::LongSumAggregation::Aggregate
void Aggregate(double, const PointAttributes &) noexcept override
Definition: includes/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h:29
sdk::metrics::SumPointData
Definition: includes/opentelemetry/sdk/metrics/data/point_data.h:24
OPENTELEMETRY_BEGIN_NAMESPACE
#define OPENTELEMETRY_BEGIN_NAMESPACE
Definition: includes/opentelemetry/version.h:21
OPENTELEMETRY_END_NAMESPACE
#define OPENTELEMETRY_END_NAMESPACE
Definition: includes/opentelemetry/version.h:24
sdk::metrics::DoubleSumAggregation
Definition: includes/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h:42
sdk::metrics::LongSumAggregation
Definition: includes/opentelemetry/sdk/metrics/aggregation/sum_aggregation.h:21
sdk::metrics::Aggregation
Definition: includes/opentelemetry/sdk/metrics/aggregation/aggregation.h:16
sdk::metrics::LongSumAggregation::Merge
std::unique_ptr< Aggregation > Merge(const Aggregation &delta) const noexcept override
sdk::metrics::LongSumAggregation::Aggregate
void Aggregate(int64_t value, const PointAttributes &attributes={}) noexcept override
sdk
Definition: includes/opentelemetry/sdk/common/atomic_shared_ptr.h:13
sdk::metrics::LongSumAggregation::ToPoint
PointType ToPoint() const noexcept override
sdk::metrics::LongSumAggregation::Diff
std::unique_ptr< Aggregation > Diff(const Aggregation &next) const noexcept override
metrics
Definition: includes/opentelemetry/metrics/async_instruments.h:10
sdk::metrics::LongSumAggregation::LongSumAggregation
LongSumAggregation(bool is_monotonic)
sdk::metrics::PointType
opentelemetry::nostd::variant< SumPointData, HistogramPointData, Base2ExponentialHistogramPointData, LastValuePointData, DropPointData > PointType
Definition: includes/opentelemetry/sdk/metrics/data/metric_data.h:25
opentelemetry
Definition: includes/opentelemetry/exporters/otlp/otlp_grpc_client.h:38
common
Definition: includes/opentelemetry/common/attribute_value.h:14