summaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/metrics/metric_registry.cpp
diff options
context:
space:
mode:
authorborman <[email protected]>2022-12-09 12:46:57 +0300
committerborman <[email protected]>2022-12-09 12:46:57 +0300
commitaf9f3fc1ae4712171d64ba9ad5855326b05b68df (patch)
treefe252250cd05ed6f4901fdbef8460a28bc49757a /library/cpp/monlib/metrics/metric_registry.cpp
parent216e087ea762ae7e4f19e219a18360a93adf8ae6 (diff)
Fix static type hints for LazyIntGauge: GAUGE -> IGAUGE
This would previously break repeated metric access. Should not affect production code, since the static type hint is only used for checking against an already-present metric at creation time. Also, added idempotency checks to registry unit tests.
Diffstat (limited to 'library/cpp/monlib/metrics/metric_registry.cpp')
-rw-r--r--library/cpp/monlib/metrics/metric_registry.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/cpp/monlib/metrics/metric_registry.cpp b/library/cpp/monlib/metrics/metric_registry.cpp
index b986f40249f..5c6cabf2fc7 100644
--- a/library/cpp/monlib/metrics/metric_registry.cpp
+++ b/library/cpp/monlib/metrics/metric_registry.cpp
@@ -77,11 +77,11 @@ namespace NMonitoring {
}
TLazyIntGauge* TMetricRegistry::LazyIntGauge(TLabels labels, std::function<i64()> supplier) {
- return Metric<TLazyIntGauge, EMetricType::GAUGE>(std::move(labels), std::move(supplier));
+ return Metric<TLazyIntGauge, EMetricType::IGAUGE>(std::move(labels), std::move(supplier));
}
TLazyIntGauge* TMetricRegistry::LazyIntGauge(ILabelsPtr labels, std::function<i64()> supplier) {
- return Metric<TLazyIntGauge, EMetricType::GAUGE>(std::move(labels), std::move(supplier));
+ return Metric<TLazyIntGauge, EMetricType::IGAUGE>(std::move(labels), std::move(supplier));
}
TCounter* TMetricRegistry::Counter(TLabels labels) {