diff options
author | miktorius <miktorius@yandex-team.com> | 2025-03-06 12:11:55 +0300 |
---|---|---|
committer | miktorius <miktorius@yandex-team.com> | 2025-03-06 14:53:44 +0300 |
commit | 618663dff0c22bb5fc2a8b1d946d6b91ac572fb4 (patch) | |
tree | 09d317c27318a1bf8b5c2ab3cba9415990432321 /library/cpp/monlib/encode/json/ut | |
parent | 89948053154b88163e209389b19a93d81f8235e7 (diff) | |
download | ydb-618663dff0c22bb5fc2a8b1d946d6b91ac572fb4.tar.gz |
monlib : memOnly support for JSON encoding/decoding (cpp)
json encoder memonly
attempt
commit_hash:0cef79f66356a94c398c76dc9baf2fe3ea9a6948
Diffstat (limited to 'library/cpp/monlib/encode/json/ut')
4 files changed, 193 insertions, 0 deletions
diff --git a/library/cpp/monlib/encode/json/ut/expected_buffered_memOnly.json b/library/cpp/monlib/encode/json/ut/expected_buffered_memOnly.json new file mode 100644 index 00000000000..7273c2e4779 --- /dev/null +++ b/library/cpp/monlib/encode/json/ut/expected_buffered_memOnly.json @@ -0,0 +1,95 @@ +{ + "ts":1500000000, + "commonLabels": + { + "project":"solomon" + }, + "sensors": + [ + { + "kind":"COUNTER", + "labels": + { + "labels":"l1", + "metric":"single" + }, + "memOnly":true, + "ts":1509843723, + "value":17 + }, + { + "kind":"RATE", + "labels": + { + "labels":"l2", + "metric":"single" + }, + "ts":1509843723, + "value":17 + }, + { + "kind":"GAUGE", + "labels": + { + "labels":"l3", + "metric":"single" + }, + "ts":1509843723, + "value":3.14 + }, + { + "kind":"IGAUGE", + "labels": + { + "labels":"l4", + "metric":"single_igauge" + }, + "ts":1509843723, + "value":42 + }, + { + "kind":"GAUGE", + "labels": + { + "labels":"l5", + "metric":"multiple" + }, + "timeseries": + [ + { + "ts":1509843723, + "value":"nan" + }, + { + "ts":1509843738, + "value":"inf" + }, + { + "ts":1509843753, + "value":"-inf" + } + ] + }, + { + "kind":"COUNTER", + "labels": + { + "labels":"l6", + "metric":"multiple" + }, + "memOnly":true, + "timeseries": + [ + { + "ts":1509843723, + "value":1337 + }, + { + "ts":1509843738, + "value":1338 + } + ] + } + ] + } +
\ No newline at end of file diff --git a/library/cpp/monlib/encode/json/ut/expected_memOnly.json b/library/cpp/monlib/encode/json/ut/expected_memOnly.json new file mode 100644 index 00000000000..ee3398427b9 --- /dev/null +++ b/library/cpp/monlib/encode/json/ut/expected_memOnly.json @@ -0,0 +1,95 @@ +{ + "ts":1500000000, + "commonLabels": + { + "project":"solomon" + }, + "sensors": + [ + { + "kind":"COUNTER", + "labels": + { + "metric":"single", + "labels":"l1" + }, + "memOnly":true, + "ts":1509843723, + "value":17 + }, + { + "kind":"RATE", + "labels": + { + "metric":"single", + "labels":"l2" + }, + "ts":1509843723, + "value":17 + }, + { + "kind":"GAUGE", + "labels": + { + "metric":"single", + "labels":"l3" + }, + "ts":1509843723, + "value":3.14 + }, + { + "kind":"IGAUGE", + "labels": + { + "metric":"single_igauge", + "labels":"l4" + }, + "ts":1509843723, + "value":42 + }, + { + "kind":"GAUGE", + "labels": + { + "metric":"multiple", + "labels":"l5" + }, + "timeseries": + [ + { + "ts":1509843723, + "value":"nan" + }, + { + "ts":1509843738, + "value":"inf" + }, + { + "ts":1509843753, + "value":"-inf" + } + ] + }, + { + "kind":"COUNTER", + "memOnly":true, + "timeseries": + [ + { + "ts":1509843723, + "value":1337 + }, + { + "ts":1509843738, + "value":1338 + } + ], + "labels": + { + "metric":"multiple", + "labels":"l6" + } + } + ] + } +
\ No newline at end of file diff --git a/library/cpp/monlib/encode/json/ut/metrics.json b/library/cpp/monlib/encode/json/ut/metrics.json index 2be4617d515..80547792aea 100644 --- a/library/cpp/monlib/encode/json/ut/metrics.json +++ b/library/cpp/monlib/encode/json/ut/metrics.json @@ -27,6 +27,7 @@ { "type": "GAUGE", "labels": { "metric": "Writes" }, + "memOnly": true, "timeseries": [ { "ts": "2017-08-28T12:32:11Z", diff --git a/library/cpp/monlib/encode/json/ut/ya.make b/library/cpp/monlib/encode/json/ut/ya.make index 9be38d2fd47..fbc26536de7 100644 --- a/library/cpp/monlib/encode/json/ut/ya.make +++ b/library/cpp/monlib/encode/json/ut/ya.make @@ -10,7 +10,9 @@ RESOURCE( buffered_ts_merge.json /buffered_ts_merge.json empty_series.json /empty_series.json expected.json /expected.json + expected_memOnly.json /expected_memOnly.json expected_buffered.json /expected_buffered.json + expected_buffered_memOnly.json /expected_buffered_memOnly.json expected_cloud.json /expected_cloud.json expected_cloud_buffered.json /expected_cloud_buffered.json merged.json /merged.json |