NVIDIA DeepStream SDK API Reference

9.2 Release
includes/prometheus/client_metric.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #pragma once
19 
20 #include <cstdint>
21 #include <string>
22 #include <tuple>
23 #include <vector>
24 
25 #include "prometheus/detail/core_export.h"
26 
27 namespace prometheus {
28 
30  // Label
31 
32  struct Label {
33  std::string name;
34  std::string value;
35 
36  friend bool operator<(const Label& lhs, const Label& rhs) {
37  return std::tie(lhs.name, lhs.value) < std::tie(rhs.name, rhs.value);
38  }
39 
40  friend bool operator==(const Label& lhs, const Label& rhs) {
41  return std::tie(lhs.name, lhs.value) == std::tie(rhs.name, rhs.value);
42  }
43  };
44  std::vector<Label> label;
45 
46  // Counter
47 
48  struct Counter {
49  double value = 0.0;
50  };
52 
53  // Gauge
54 
55  struct Gauge {
56  double value = 0.0;
57  };
59 
60  // Info
61 
62  struct Info {
63  double value = 1.0;
64  };
66 
67  // Summary
68 
69  struct Quantile {
70  double quantile = 0.0;
71  double value = 0.0;
72  };
73 
74  struct Summary {
75  std::uint64_t sample_count = 0;
76  double sample_sum = 0.0;
77  std::vector<Quantile> quantile;
78  };
80 
81  // Histogram
82 
83  struct Bucket {
84  std::uint64_t cumulative_count = 0;
85  double upper_bound = 0.0;
86  };
87 
88  struct Histogram {
89  std::uint64_t sample_count = 0;
90  double sample_sum = 0.0;
91  std::vector<Bucket> bucket;
92  };
94 
95  // Untyped
96 
97  struct Untyped {
98  double value = 0;
99  };
101 
102  // Timestamp
103 
104  std::int64_t timestamp_ms = 0;
105 };
106 
107 } // namespace prometheus
prometheus::ClientMetric::Quantile
Definition: includes/prometheus/client_metric.h:69
prometheus::ClientMetric::counter
Counter counter
Definition: includes/prometheus/client_metric.h:51
prometheus::ClientMetric::Label::name
std::string name
Definition: includes/prometheus/client_metric.h:33
prometheus::ClientMetric::info
Info info
Definition: includes/prometheus/client_metric.h:65
prometheus::ClientMetric::Histogram
Definition: includes/prometheus/client_metric.h:88
prometheus::ClientMetric::Label::operator==
friend bool operator==(const Label &lhs, const Label &rhs)
Definition: includes/prometheus/client_metric.h:40
prometheus::ClientMetric::Label::operator<
friend bool operator<(const Label &lhs, const Label &rhs)
Definition: includes/prometheus/client_metric.h:36
prometheus::ClientMetric::Counter
Definition: includes/prometheus/client_metric.h:48
prometheus::ClientMetric
Definition: includes/prometheus/client_metric.h:29
prometheus::ClientMetric::Label
Definition: includes/prometheus/client_metric.h:32
prometheus::ClientMetric::histogram
Histogram histogram
Definition: includes/prometheus/client_metric.h:93
prometheus::ClientMetric::gauge
Gauge gauge
Definition: includes/prometheus/client_metric.h:58
PROMETHEUS_CPP_CORE_EXPORT
#define PROMETHEUS_CPP_CORE_EXPORT
Definition: includes/prometheus/detail/core_export.h:31
prometheus::ClientMetric::Label::value
std::string value
Definition: includes/prometheus/client_metric.h:34
prometheus::ClientMetric::untyped
Untyped untyped
Definition: includes/prometheus/client_metric.h:100
prometheus::ClientMetric::Bucket
Definition: includes/prometheus/client_metric.h:83
prometheus::ClientMetric::summary
Summary summary
Definition: includes/prometheus/client_metric.h:79
prometheus::ClientMetric::Gauge
Definition: includes/prometheus/client_metric.h:55
prometheus::ClientMetric::Histogram::bucket
std::vector< Bucket > bucket
Definition: includes/prometheus/client_metric.h:91
prometheus::ClientMetric::Info
Definition: includes/prometheus/client_metric.h:62
prometheus::ClientMetric::Untyped
Definition: includes/prometheus/client_metric.h:97
prometheus::ClientMetric::Summary::quantile
std::vector< Quantile > quantile
Definition: includes/prometheus/client_metric.h:77
prometheus::ClientMetric::label
std::vector< Label > label
Definition: includes/prometheus/client_metric.h:44
prometheus::ClientMetric::Summary
Definition: includes/prometheus/client_metric.h:74
prometheus
Definition: includes/prometheus/check_names.h:25