aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/metrics/metric_sub_registry.h
diff options
context:
space:
mode:
authork-vukolov <k-vukolov@yandex-team.ru>2022-03-17 17:29:32 +0300
committerk-vukolov <k-vukolov@yandex-team.ru>2022-03-17 17:29:32 +0300
commit26d5a0024c9e3a3c14756599c5dd0ddda71c672b (patch)
tree39127a6a02de8e14843149118c3789f3e788dc22 /library/cpp/monlib/metrics/metric_sub_registry.h
parentb94d94d54d13127426fd034d04c428edd9d2e40a (diff)
downloadydb-26d5a0024c9e3a3c14756599c5dd0ddda71c672b.tar.gz
Do not create buckets on each metric access
ref:23778046ec41d633f28df9e49ac776b31db22afe
Diffstat (limited to 'library/cpp/monlib/metrics/metric_sub_registry.h')
-rw-r--r--library/cpp/monlib/metrics/metric_sub_registry.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/library/cpp/monlib/metrics/metric_sub_registry.h b/library/cpp/monlib/metrics/metric_sub_registry.h
index e83eeeafb2..36f8e0e639 100644
--- a/library/cpp/monlib/metrics/metric_sub_registry.h
+++ b/library/cpp/monlib/metrics/metric_sub_registry.h
@@ -100,6 +100,15 @@ public:
DelegatePtr_->RemoveMetric(toRemove);
}
+ bool HasMetric(const ILabels &labels) noexcept override {
+ TLabelsImpl<TStringBuf> toCheck;
+ for (auto& l: labels) {
+ toCheck.Add(l);
+ }
+ AddCommonLabels(&toCheck);
+ return DelegatePtr_->HasMetric(toCheck);
+ }
+
private:
void AddCommonLabels(ILabels* labels) const {
for (auto& label: CommonLabels_) {