|
| 1 | +/* |
| 2 | + * Copyright The OpenTelemetry Authors |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + */ |
| 5 | + |
| 6 | +/* |
| 7 | + * DO NOT EDIT, this is an Auto-generated file from: |
| 8 | + * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 |
| 9 | + */ |
| 10 | + |
| 11 | +#pragma once |
| 12 | + |
| 13 | +#include "opentelemetry/common/macros.h" |
| 14 | +#include "opentelemetry/metrics/meter.h" |
| 15 | +#include "opentelemetry/version.h" |
| 16 | + |
| 17 | +OPENTELEMETRY_BEGIN_NAMESPACE |
| 18 | +namespace semconv |
| 19 | +{ |
| 20 | +namespace cpython |
| 21 | +{ |
| 22 | + |
| 23 | +/** |
| 24 | + * The total number of objects collected inside a generation since interpreter start. |
| 25 | + * <p> |
| 26 | + * This metric reports data from <a |
| 27 | + * href="https://docs.python.org/3/library/gc.html#gc.get_stats">@code gc.stats() @endcode</a>. <p> |
| 28 | + * counter |
| 29 | + */ |
| 30 | +static constexpr const char *kMetricCpythonGcCollectedObjects = "cpython.gc.collected_objects"; |
| 31 | +static constexpr const char *descrMetricCpythonGcCollectedObjects = |
| 32 | + "The total number of objects collected inside a generation since interpreter start."; |
| 33 | +static constexpr const char *unitMetricCpythonGcCollectedObjects = "{object}"; |
| 34 | + |
| 35 | +static inline nostd::unique_ptr<metrics::Counter<uint64_t>> |
| 36 | +CreateSyncInt64MetricCpythonGcCollectedObjects(metrics::Meter *meter) |
| 37 | +{ |
| 38 | + return meter->CreateUInt64Counter(kMetricCpythonGcCollectedObjects, |
| 39 | + descrMetricCpythonGcCollectedObjects, |
| 40 | + unitMetricCpythonGcCollectedObjects); |
| 41 | +} |
| 42 | + |
| 43 | +static inline nostd::unique_ptr<metrics::Counter<double>> |
| 44 | +CreateSyncDoubleMetricCpythonGcCollectedObjects(metrics::Meter *meter) |
| 45 | +{ |
| 46 | + return meter->CreateDoubleCounter(kMetricCpythonGcCollectedObjects, |
| 47 | + descrMetricCpythonGcCollectedObjects, |
| 48 | + unitMetricCpythonGcCollectedObjects); |
| 49 | +} |
| 50 | + |
| 51 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 52 | +CreateAsyncInt64MetricCpythonGcCollectedObjects(metrics::Meter *meter) |
| 53 | +{ |
| 54 | + return meter->CreateInt64ObservableCounter(kMetricCpythonGcCollectedObjects, |
| 55 | + descrMetricCpythonGcCollectedObjects, |
| 56 | + unitMetricCpythonGcCollectedObjects); |
| 57 | +} |
| 58 | + |
| 59 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 60 | +CreateAsyncDoubleMetricCpythonGcCollectedObjects(metrics::Meter *meter) |
| 61 | +{ |
| 62 | + return meter->CreateDoubleObservableCounter(kMetricCpythonGcCollectedObjects, |
| 63 | + descrMetricCpythonGcCollectedObjects, |
| 64 | + unitMetricCpythonGcCollectedObjects); |
| 65 | +} |
| 66 | + |
| 67 | +/** |
| 68 | + * The number of times a generation was collected since interpreter start. |
| 69 | + * <p> |
| 70 | + * This metric reports data from <a |
| 71 | + * href="https://docs.python.org/3/library/gc.html#gc.get_stats">@code gc.stats() @endcode</a>. <p> |
| 72 | + * counter |
| 73 | + */ |
| 74 | +static constexpr const char *kMetricCpythonGcCollections = "cpython.gc.collections"; |
| 75 | +static constexpr const char *descrMetricCpythonGcCollections = |
| 76 | + "The number of times a generation was collected since interpreter start."; |
| 77 | +static constexpr const char *unitMetricCpythonGcCollections = "{collection}"; |
| 78 | + |
| 79 | +static inline nostd::unique_ptr<metrics::Counter<uint64_t>> |
| 80 | +CreateSyncInt64MetricCpythonGcCollections(metrics::Meter *meter) |
| 81 | +{ |
| 82 | + return meter->CreateUInt64Counter(kMetricCpythonGcCollections, descrMetricCpythonGcCollections, |
| 83 | + unitMetricCpythonGcCollections); |
| 84 | +} |
| 85 | + |
| 86 | +static inline nostd::unique_ptr<metrics::Counter<double>> |
| 87 | +CreateSyncDoubleMetricCpythonGcCollections(metrics::Meter *meter) |
| 88 | +{ |
| 89 | + return meter->CreateDoubleCounter(kMetricCpythonGcCollections, descrMetricCpythonGcCollections, |
| 90 | + unitMetricCpythonGcCollections); |
| 91 | +} |
| 92 | + |
| 93 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 94 | +CreateAsyncInt64MetricCpythonGcCollections(metrics::Meter *meter) |
| 95 | +{ |
| 96 | + return meter->CreateInt64ObservableCounter( |
| 97 | + kMetricCpythonGcCollections, descrMetricCpythonGcCollections, unitMetricCpythonGcCollections); |
| 98 | +} |
| 99 | + |
| 100 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 101 | +CreateAsyncDoubleMetricCpythonGcCollections(metrics::Meter *meter) |
| 102 | +{ |
| 103 | + return meter->CreateDoubleObservableCounter( |
| 104 | + kMetricCpythonGcCollections, descrMetricCpythonGcCollections, unitMetricCpythonGcCollections); |
| 105 | +} |
| 106 | + |
| 107 | +/** |
| 108 | + * The total number of objects which were found to be uncollectable inside a generation since |
| 109 | + * interpreter start. <p> This metric reports data from <a |
| 110 | + * href="https://docs.python.org/3/library/gc.html#gc.get_stats">@code gc.stats() @endcode</a>. <p> |
| 111 | + * counter |
| 112 | + */ |
| 113 | +static constexpr const char *kMetricCpythonGcUncollectableObjects = |
| 114 | + "cpython.gc.uncollectable_objects"; |
| 115 | +static constexpr const char *descrMetricCpythonGcUncollectableObjects = |
| 116 | + "The total number of objects which were found to be uncollectable inside a generation since " |
| 117 | + "interpreter start."; |
| 118 | +static constexpr const char *unitMetricCpythonGcUncollectableObjects = "{object}"; |
| 119 | + |
| 120 | +static inline nostd::unique_ptr<metrics::Counter<uint64_t>> |
| 121 | +CreateSyncInt64MetricCpythonGcUncollectableObjects(metrics::Meter *meter) |
| 122 | +{ |
| 123 | + return meter->CreateUInt64Counter(kMetricCpythonGcUncollectableObjects, |
| 124 | + descrMetricCpythonGcUncollectableObjects, |
| 125 | + unitMetricCpythonGcUncollectableObjects); |
| 126 | +} |
| 127 | + |
| 128 | +static inline nostd::unique_ptr<metrics::Counter<double>> |
| 129 | +CreateSyncDoubleMetricCpythonGcUncollectableObjects(metrics::Meter *meter) |
| 130 | +{ |
| 131 | + return meter->CreateDoubleCounter(kMetricCpythonGcUncollectableObjects, |
| 132 | + descrMetricCpythonGcUncollectableObjects, |
| 133 | + unitMetricCpythonGcUncollectableObjects); |
| 134 | +} |
| 135 | + |
| 136 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 137 | +CreateAsyncInt64MetricCpythonGcUncollectableObjects(metrics::Meter *meter) |
| 138 | +{ |
| 139 | + return meter->CreateInt64ObservableCounter(kMetricCpythonGcUncollectableObjects, |
| 140 | + descrMetricCpythonGcUncollectableObjects, |
| 141 | + unitMetricCpythonGcUncollectableObjects); |
| 142 | +} |
| 143 | + |
| 144 | +static inline nostd::shared_ptr<metrics::ObservableInstrument> |
| 145 | +CreateAsyncDoubleMetricCpythonGcUncollectableObjects(metrics::Meter *meter) |
| 146 | +{ |
| 147 | + return meter->CreateDoubleObservableCounter(kMetricCpythonGcUncollectableObjects, |
| 148 | + descrMetricCpythonGcUncollectableObjects, |
| 149 | + unitMetricCpythonGcUncollectableObjects); |
| 150 | +} |
| 151 | + |
| 152 | +} // namespace cpython |
| 153 | +} // namespace semconv |
| 154 | +OPENTELEMETRY_END_NAMESPACE |
0 commit comments