aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/metrics/metric_registry.cpp
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-28 22:13:30 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-06-28 22:13:30 +0300
commit4a1a5df355bdd769225c8086601b4cdf5a651b00 (patch)
treedf36db92a40b10f9c374f349a27e9b9ffe1dafee /library/cpp/monlib/metrics/metric_registry.cpp
parent04cb855dd32a856dab4ec1f0695c88b170c50d58 (diff)
downloadydb-4a1a5df355bdd769225c8086601b4cdf5a651b00.tar.gz
intermediate changes
ref:08d0f6ebc75701201720c15ba8b41bfbdf780a37
Diffstat (limited to 'library/cpp/monlib/metrics/metric_registry.cpp')
-rw-r--r--library/cpp/monlib/metrics/metric_registry.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/library/cpp/monlib/metrics/metric_registry.cpp b/library/cpp/monlib/metrics/metric_registry.cpp
index 9a09a78d6b..b986f40249 100644
--- a/library/cpp/monlib/metrics/metric_registry.cpp
+++ b/library/cpp/monlib/metrics/metric_registry.cpp
@@ -128,8 +128,8 @@ namespace NMonitoring {
return Metric<THistogram, EMetricType::HIST>(std::move(labels), std::move(supplier), false);
}
- THistogram* TMetricRegistry::HistogramCounter(TLabels labels, nullptr_t) {
- return HistogramCounter(std::move(labels), IHistogramCollectorPtr(nullptr));
+ THistogram* TMetricRegistry::HistogramCounter(ILabelsPtr labels, std::function<IHistogramCollectorPtr()> supplier) {
+ return Metric<THistogram, EMetricType::HIST>(std::move(labels), std::move(supplier), false);
}
THistogram* TMetricRegistry::HistogramRate(TLabels labels, IHistogramCollectorPtr collector) {
@@ -144,8 +144,8 @@ namespace NMonitoring {
return Metric<THistogram, EMetricType::HIST_RATE>(std::move(labels), std::move(supplier), true);
}
- THistogram* TMetricRegistry::HistogramRate(TLabels labels, nullptr_t) {
- return HistogramRate(std::move(labels), IHistogramCollectorPtr(nullptr));
+ THistogram* TMetricRegistry::HistogramRate(ILabelsPtr labels, std::function<IHistogramCollectorPtr()> supplier) {
+ return Metric<THistogram, EMetricType::HIST_RATE>(std::move(labels), std::move(supplier), true);
}
void TMetricRegistry::Reset() {
@@ -216,12 +216,6 @@ namespace NMonitoring {
Metrics_.erase(labels);
}
- bool TMetricRegistry::HasMetric(const ILabels &labels) noexcept {
- TReadGuard g{*Lock_};
-
- return Metrics_.contains(labels);
- }
-
void TMetricRegistry::Accept(TInstant time, IMetricConsumer* consumer) const {
consumer->OnStreamBegin();