diff options
author | nga <nga@yandex-team.ru> | 2022-02-10 16:48:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:09 +0300 |
commit | c2a1af049e9deca890e9923abe64fe6c59060348 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/monlib/deprecated/json/writer.h | |
parent | 1f553f46fb4f3c5eec631352cdd900a0709016af (diff) | |
download | ydb-c2a1af049e9deca890e9923abe64fe6c59060348.tar.gz |
Restoring authorship annotation for <nga@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/monlib/deprecated/json/writer.h')
-rw-r--r-- | library/cpp/monlib/deprecated/json/writer.h | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/library/cpp/monlib/deprecated/json/writer.h b/library/cpp/monlib/deprecated/json/writer.h index 2ea8ce40c1..183288143c 100644 --- a/library/cpp/monlib/deprecated/json/writer.h +++ b/library/cpp/monlib/deprecated/json/writer.h @@ -1,7 +1,7 @@ -#pragma once - +#pragma once + #include <library/cpp/json/json_writer.h> - + namespace NMonitoring { /** * Deprecated writer of Solomon JSON format @@ -12,24 +12,24 @@ namespace NMonitoring { * particular format. */ class TDeprecatedJsonWriter { - private: - NJson::TJsonWriter JsonWriter; - enum EState { - STATE_ROOT, - STATE_DOCUMENT, + private: + NJson::TJsonWriter JsonWriter; + enum EState { + STATE_ROOT, + STATE_DOCUMENT, STATE_COMMON_LABELS, STATE_METRICS, STATE_METRIC, - STATE_LABELS, - }; - EState State; + STATE_LABELS, + }; + EState State; - public: + public: explicit TDeprecatedJsonWriter(IOutputStream* out); - - void OpenDocument(); - void CloseDocument(); - + + void OpenDocument(); + void CloseDocument(); + void OpenCommonLabels(); void CloseCommonLabels(); @@ -37,40 +37,40 @@ namespace NMonitoring { void OpenMetrics(); void CloseMetrics(); - + void OpenMetric(); void CloseMetric(); - - void OpenLabels(); - void CloseLabels(); - - void WriteLabel(TStringBuf name, TStringBuf value); - - template <typename... T> - void WriteLabels(T... pairs) { - OpenLabels(); - WriteLabelsInner(pairs...); - CloseLabels(); - } - - void WriteModeDeriv(); - - void WriteValue(long long value); - void WriteDoubleValue(double d); + + void OpenLabels(); + void CloseLabels(); + + void WriteLabel(TStringBuf name, TStringBuf value); + + template <typename... T> + void WriteLabels(T... pairs) { + OpenLabels(); + WriteLabelsInner(pairs...); + CloseLabels(); + } + + void WriteModeDeriv(); + + void WriteValue(long long value); + void WriteDoubleValue(double d); void WriteTs(ui64 ts); - private: - void WriteLabelsInner(TStringBuf name, TStringBuf value) { - WriteLabel(name, value); - } - + private: + void WriteLabelsInner(TStringBuf name, TStringBuf value) { + WriteLabel(name, value); + } + template <typename... T> - void WriteLabelsInner(TStringBuf name, TStringBuf value, T... pairs) { - WriteLabel(name, value); - WriteLabelsInner(pairs...); - } - - inline void TransitionState(EState current, EState next); - }; + void WriteLabelsInner(TStringBuf name, TStringBuf value, T... pairs) { + WriteLabel(name, value); + WriteLabelsInner(pairs...); + } + + inline void TransitionState(EState current, EState next); + }; } |