diff options
author | Sergey Polovko <sergey@polovko.me> | 2022-02-10 16:47:02 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:02 +0300 |
commit | 3e0b762a82514bac89c1dd6ea7211e381d8aa248 (patch) | |
tree | c2d1b379ecaf05ca8f11ed0b5da9d1a950e6e554 /library/cpp/monlib/deprecated/json/writer.h | |
parent | ab3783171cc30e262243a0227c86118f7080c896 (diff) | |
download | ydb-3e0b762a82514bac89c1dd6ea7211e381d8aa248.tar.gz |
Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/monlib/deprecated/json/writer.h')
-rw-r--r-- | library/cpp/monlib/deprecated/json/writer.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/monlib/deprecated/json/writer.h b/library/cpp/monlib/deprecated/json/writer.h index 183288143c..003992dd9f 100644 --- a/library/cpp/monlib/deprecated/json/writer.h +++ b/library/cpp/monlib/deprecated/json/writer.h @@ -2,30 +2,30 @@ #include <library/cpp/json/json_writer.h> -namespace NMonitoring { - /** - * Deprecated writer of Solomon JSON format - * https://wiki.yandex-team.ru/solomon/api/dataformat/json - * - * This writer will be deleted soon, so please consider to use - * high level library library/cpp/monlib/encode which is decoupled from the - * particular format. - */ - class TDeprecatedJsonWriter { +namespace NMonitoring { + /** + * Deprecated writer of Solomon JSON format + * https://wiki.yandex-team.ru/solomon/api/dataformat/json + * + * This writer will be deleted soon, so please consider to use + * high level library library/cpp/monlib/encode which is decoupled from the + * particular format. + */ + class TDeprecatedJsonWriter { private: NJson::TJsonWriter JsonWriter; enum EState { STATE_ROOT, STATE_DOCUMENT, STATE_COMMON_LABELS, - STATE_METRICS, - STATE_METRIC, + STATE_METRICS, + STATE_METRIC, STATE_LABELS, }; EState State; - + public: - explicit TDeprecatedJsonWriter(IOutputStream* out); + explicit TDeprecatedJsonWriter(IOutputStream* out); void OpenDocument(); void CloseDocument(); @@ -35,11 +35,11 @@ namespace NMonitoring { void WriteCommonLabel(TStringBuf name, TStringBuf value); - void OpenMetrics(); - void CloseMetrics(); + void OpenMetrics(); + void CloseMetrics(); - void OpenMetric(); - void CloseMetric(); + void OpenMetric(); + void CloseMetric(); void OpenLabels(); void CloseLabels(); @@ -59,13 +59,13 @@ namespace NMonitoring { void WriteDoubleValue(double d); void WriteTs(ui64 ts); - + private: void WriteLabelsInner(TStringBuf name, TStringBuf value) { WriteLabel(name, value); } - template <typename... T> + template <typename... T> void WriteLabelsInner(TStringBuf name, TStringBuf value, T... pairs) { WriteLabel(name, value); WriteLabelsInner(pairs...); @@ -73,4 +73,4 @@ namespace NMonitoring { inline void TransitionState(EState current, EState next); }; -} +} |