diff options
author | kgershov <kgershov@yandex-team.com> | 2023-08-28 10:47:37 +0300 |
---|---|---|
committer | kgershov <kgershov@yandex-team.com> | 2023-08-28 11:01:49 +0300 |
commit | 02bb32604c0d20f5af0ce6c7e2d294206153045d (patch) | |
tree | 3c03e25b09e2dd9e6afbd1d5388b2c17781d78d8 /library/cpp/monlib | |
parent | 926d7bd8f9208d89c1bd1f088c50f814fb38f84d (diff) | |
download | ydb-02bb32604c0d20f5af0ce6c7e2d294206153045d.tar.gz |
[fetcher] support unistat
Diffstat (limited to 'library/cpp/monlib')
-rw-r--r-- | library/cpp/monlib/encode/format.cpp | 9 | ||||
-rw-r--r-- | library/cpp/monlib/encode/format.h | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/library/cpp/monlib/encode/format.cpp b/library/cpp/monlib/encode/format.cpp index 3a7f8f6dee..fd16d690cb 100644 --- a/library/cpp/monlib/encode/format.cpp +++ b/library/cpp/monlib/encode/format.cpp @@ -40,6 +40,8 @@ namespace NMonitoring { return EFormat::TEXT; } else if (AsciiEqualsIgnoreCase(value, NFormatContenType::PROMETHEUS)) { return EFormat::PROMETHEUS; + } else if (AsciiEqualsIgnoreCase(value, NFormatContenType::UNISTAT)) { + return EFormat::UNISTAT; } return EFormat::UNKNOWN; @@ -78,6 +80,8 @@ namespace NMonitoring { return NFormatContenType::TEXT; case EFormat::PROMETHEUS: return NFormatContenType::PROMETHEUS; + case EFormat::UNISTAT: + return NFormatContenType::UNISTAT; case EFormat::UNKNOWN: return TStringBuf(); } @@ -126,6 +130,8 @@ NMonitoring::EFormat FromStringImpl<NMonitoring::EFormat>(const char* str, size_ return EFormat::TEXT; } else if (value == TStringBuf("PROMETHEUS")) { return EFormat::PROMETHEUS; + } else if (value == TStringBuf("UNISTAT")) { + return EFormat::UNISTAT; } else if (value == TStringBuf("UNKNOWN")) { return EFormat::UNKNOWN; } @@ -151,6 +157,9 @@ void Out<NMonitoring::EFormat>(IOutputStream& o, NMonitoring::EFormat f) { case EFormat::PROMETHEUS: o << TStringBuf("PROMETHEUS"); return; + case EFormat::UNISTAT: + o << TStringBuf("UNISTAT"); + return; case EFormat::UNKNOWN: o << TStringBuf("UNKNOWN"); return; diff --git a/library/cpp/monlib/encode/format.h b/library/cpp/monlib/encode/format.h index 7c916eaa28..d363945ec3 100644 --- a/library/cpp/monlib/encode/format.h +++ b/library/cpp/monlib/encode/format.h @@ -39,6 +39,11 @@ namespace NMonitoring { JSON, /** + * Read more https://wiki.yandex-team.ru/golovan/userdocs/stat-handle + */ + UNISTAT, + + /** * Simple protobuf format, only for testing purposes. */ PROTOBUF, |