aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/encode/json/json_decoder_ut.cpp
diff options
context:
space:
mode:
authorgusev-p <gusev-p@yandex-team.ru>2022-02-10 16:47:20 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:20 +0300
commit47af3b5bf148ddab250833ec454d30d7c4930c31 (patch)
tree9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/cpp/monlib/encode/json/json_decoder_ut.cpp
parent1715700d00b30399d3648be821fd585ae552365e (diff)
downloadydb-47af3b5bf148ddab250833ec454d30d7c4930c31.tar.gz
Restoring authorship annotation for <gusev-p@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/monlib/encode/json/json_decoder_ut.cpp')
-rw-r--r--library/cpp/monlib/encode/json/json_decoder_ut.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/library/cpp/monlib/encode/json/json_decoder_ut.cpp b/library/cpp/monlib/encode/json/json_decoder_ut.cpp
index 52c34e4f37..4464e1d26a 100644
--- a/library/cpp/monlib/encode/json/json_decoder_ut.cpp
+++ b/library/cpp/monlib/encode/json/json_decoder_ut.cpp
@@ -120,60 +120,60 @@ Y_UNIT_TEST_SUITE(TJsonDecoderTest) {
ValidateCommonParts(std::move(commonParts), true, true);
ValidateMetrics(collector.Metrics);
}
-
- Y_UNIT_TEST(CanParseHistogramsWithInf) {
- const char* metricsData = R"({
-"metrics":
- [
- {
- "hist": {
- "bounds": [
- 10
- ],
- "buckets": [
- 11
- ],
- "inf": 12
- },
- "name":"s1",
- "type": "HIST_RATE"
- },
- {
- "hist": {
- "bounds": [
- 20
- ],
- "buckets": [
- 21
- ]
- },
- "name":"s2",
- "type":"HIST_RATE"
- }
- ]
-})";
- TCollectingConsumer consumer(false);
- DecodeJson(metricsData, &consumer);
-
- UNIT_ASSERT_VALUES_EQUAL(consumer.Metrics.size(), 2);
- {
- const auto& m = consumer.Metrics[0];
- UNIT_ASSERT_VALUES_EQUAL(m.Kind, EMetricType::HIST_RATE);
- UNIT_ASSERT_VALUES_EQUAL(m.Values->Size(), 1);
- const auto* histogram = (*m.Values)[0].GetValue().AsHistogram();
- UNIT_ASSERT_VALUES_EQUAL(histogram->Count(), 2);
- UNIT_ASSERT_VALUES_EQUAL(histogram->UpperBound(1), Max<TBucketBound>());
- UNIT_ASSERT_VALUES_EQUAL(histogram->Value(0), 11);
- UNIT_ASSERT_VALUES_EQUAL(histogram->Value(1), 12);
- }
- {
- const auto& m = consumer.Metrics[1];
- UNIT_ASSERT_VALUES_EQUAL(m.Kind, EMetricType::HIST_RATE);
- UNIT_ASSERT_VALUES_EQUAL(m.Values->Size(), 1);
- const auto* histogram = (*m.Values)[0].GetValue().AsHistogram();
- UNIT_ASSERT_VALUES_EQUAL(histogram->Count(), 1);
- UNIT_ASSERT_VALUES_EQUAL(histogram->UpperBound(0), 20);
- UNIT_ASSERT_VALUES_EQUAL(histogram->Value(0), 21);
- }
- }
+
+ Y_UNIT_TEST(CanParseHistogramsWithInf) {
+ const char* metricsData = R"({
+"metrics":
+ [
+ {
+ "hist": {
+ "bounds": [
+ 10
+ ],
+ "buckets": [
+ 11
+ ],
+ "inf": 12
+ },
+ "name":"s1",
+ "type": "HIST_RATE"
+ },
+ {
+ "hist": {
+ "bounds": [
+ 20
+ ],
+ "buckets": [
+ 21
+ ]
+ },
+ "name":"s2",
+ "type":"HIST_RATE"
+ }
+ ]
+})";
+ TCollectingConsumer consumer(false);
+ DecodeJson(metricsData, &consumer);
+
+ UNIT_ASSERT_VALUES_EQUAL(consumer.Metrics.size(), 2);
+ {
+ const auto& m = consumer.Metrics[0];
+ UNIT_ASSERT_VALUES_EQUAL(m.Kind, EMetricType::HIST_RATE);
+ UNIT_ASSERT_VALUES_EQUAL(m.Values->Size(), 1);
+ const auto* histogram = (*m.Values)[0].GetValue().AsHistogram();
+ UNIT_ASSERT_VALUES_EQUAL(histogram->Count(), 2);
+ UNIT_ASSERT_VALUES_EQUAL(histogram->UpperBound(1), Max<TBucketBound>());
+ UNIT_ASSERT_VALUES_EQUAL(histogram->Value(0), 11);
+ UNIT_ASSERT_VALUES_EQUAL(histogram->Value(1), 12);
+ }
+ {
+ const auto& m = consumer.Metrics[1];
+ UNIT_ASSERT_VALUES_EQUAL(m.Kind, EMetricType::HIST_RATE);
+ UNIT_ASSERT_VALUES_EQUAL(m.Values->Size(), 1);
+ const auto* histogram = (*m.Values)[0].GetValue().AsHistogram();
+ UNIT_ASSERT_VALUES_EQUAL(histogram->Count(), 1);
+ UNIT_ASSERT_VALUES_EQUAL(histogram->UpperBound(0), 20);
+ UNIT_ASSERT_VALUES_EQUAL(histogram->Value(0), 21);
+ }
+ }
}