aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/metrics/labels.cpp
diff options
context:
space:
mode:
authorSergey Polovko <sergey@polovko.me>2022-02-10 16:47:02 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:02 +0300
commit3e0b762a82514bac89c1dd6ea7211e381d8aa248 (patch)
treec2d1b379ecaf05ca8f11ed0b5da9d1a950e6e554 /library/cpp/monlib/metrics/labels.cpp
parentab3783171cc30e262243a0227c86118f7080c896 (diff)
downloadydb-3e0b762a82514bac89c1dd6ea7211e381d8aa248.tar.gz
Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/monlib/metrics/labels.cpp')
-rw-r--r--library/cpp/monlib/metrics/labels.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/monlib/metrics/labels.cpp b/library/cpp/monlib/metrics/labels.cpp
index 1eaadb7cba..226bf5df26 100644
--- a/library/cpp/monlib/metrics/labels.cpp
+++ b/library/cpp/monlib/metrics/labels.cpp
@@ -1,31 +1,31 @@
-#include "labels.h"
-
+#include "labels.h"
+
#include <util/stream/output.h>
#include <util/string/split.h>
-
-static void OutputLabels(IOutputStream& out, const NMonitoring::ILabels& labels) {
- size_t i = 0;
+
+static void OutputLabels(IOutputStream& out, const NMonitoring::ILabels& labels) {
+ size_t i = 0;
out << '{';
- for (const auto& label: labels) {
- if (i++ > 0) {
+ for (const auto& label: labels) {
+ if (i++ > 0) {
out << TStringBuf(", ");
}
- out << label;
- }
+ out << label;
+ }
out << '}';
}
template <>
-void Out<NMonitoring::ILabelsPtr>(IOutputStream& out, const NMonitoring::ILabelsPtr& labels) {
- OutputLabels(out, *labels);
-}
-
-template <>
-void Out<NMonitoring::ILabels>(IOutputStream& out, const NMonitoring::ILabels& labels) {
- OutputLabels(out, labels);
-}
-
-template <>
+void Out<NMonitoring::ILabelsPtr>(IOutputStream& out, const NMonitoring::ILabelsPtr& labels) {
+ OutputLabels(out, *labels);
+}
+
+template <>
+void Out<NMonitoring::ILabels>(IOutputStream& out, const NMonitoring::ILabels& labels) {
+ OutputLabels(out, labels);
+}
+
+template <>
void Out<NMonitoring::ILabel>(IOutputStream& out, const NMonitoring::ILabel& labels) {
out << labels.Name() << "=" << labels.Value();
}