NVIDIA DeepStream SDK API Reference

9.2 Release
includes/opentelemetry/sdk/metrics/aggregation/lastvalue_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 {
21 {
22 public:
25 
26  void Aggregate(int64_t value, const PointAttributes &attributes = {}) noexcept override;
27 
28  void Aggregate(double /* value */, const PointAttributes & /* attributes */) noexcept override {}
29 
30  std::unique_ptr<Aggregation> Merge(const Aggregation &delta) const noexcept override;
31 
32  std::unique_ptr<Aggregation> Diff(const Aggregation &next) const noexcept override;
33 
34  PointType ToPoint() const noexcept override;
35 
36 private:
37  mutable opentelemetry::common::SpinLockMutex lock_;
38  LastValuePointData point_data_;
39 };
40 
42 {
43 public:
46 
47  void Aggregate(int64_t /* value */, const PointAttributes & /* attributes */) noexcept override {}
48 
49  void Aggregate(double value, const PointAttributes &attributes = {}) noexcept override;
50 
51  std::unique_ptr<Aggregation> Merge(const Aggregation &delta) const noexcept override;
52 
53  std::unique_ptr<Aggregation> Diff(const Aggregation &next) const noexcept override;
54 
55  PointType ToPoint() const noexcept override;
56 
57 private:
58  mutable opentelemetry::common::SpinLockMutex lock_;
59  mutable LastValuePointData point_data_;
60 };
61 
62 } // namespace metrics
63 } // namespace sdk
sdk::metrics::LongLastValueAggregation::LongLastValueAggregation
LongLastValueAggregation()
sdk::metrics::LongLastValueAggregation::Merge
std::unique_ptr< Aggregation > Merge(const Aggregation &delta) const noexcept override
sdk::metrics::PointAttributes
opentelemetry::sdk::common::OrderedAttributeMap PointAttributes
Definition: includes/opentelemetry/sdk/metrics/data/metric_data.h:20
sdk::metrics::DoubleLastValueAggregation::Aggregate
void Aggregate(int64_t, const PointAttributes &) noexcept override
Definition: includes/opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h:47
OPENTELEMETRY_BEGIN_NAMESPACE
#define OPENTELEMETRY_BEGIN_NAMESPACE
Definition: includes/opentelemetry/version.h:21
sdk::metrics::LongLastValueAggregation::ToPoint
PointType ToPoint() const noexcept override
sdk::metrics::LongLastValueAggregation
Definition: includes/opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h:20
sdk::metrics::DoubleLastValueAggregation
Definition: includes/opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h:41
OPENTELEMETRY_END_NAMESPACE
#define OPENTELEMETRY_END_NAMESPACE
Definition: includes/opentelemetry/version.h:24
sdk::metrics::LongLastValueAggregation::Aggregate
void Aggregate(double, const PointAttributes &) noexcept override
Definition: includes/opentelemetry/sdk/metrics/aggregation/lastvalue_aggregation.h:28
sdk::metrics::Aggregation
Definition: includes/opentelemetry/sdk/metrics/aggregation/aggregation.h:16
sdk::metrics::LongLastValueAggregation::Diff
std::unique_ptr< Aggregation > Diff(const Aggregation &next) const noexcept override
sdk::metrics::LastValuePointData
Definition: includes/opentelemetry/sdk/metrics/data/point_data.h:39
sdk
Definition: includes/opentelemetry/sdk/common/atomic_shared_ptr.h:13
metrics
Definition: includes/opentelemetry/metrics/async_instruments.h:10
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
sdk::metrics::LongLastValueAggregation::Aggregate
void Aggregate(int64_t value, const PointAttributes &attributes={}) noexcept override