diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2025-01-21 10:35:12 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2025-01-21 11:24:01 +0300 |
commit | 03ee2133f6d49649cc6b27fbbb23cf9c62128ea8 (patch) | |
tree | b2dfa998a12b5cc9481cfa9154f067a4a899a623 /library/cpp/monlib/encode/prometheus | |
parent | 06abd617f752a201ed29a300ebb676f1ceae0205 (diff) | |
download | ydb-03ee2133f6d49649cc6b27fbbb23cf9c62128ea8.tar.gz |
Intermediate changes
commit_hash:cdae472f061820ed9998426cf0624c300468cdc8
Diffstat (limited to 'library/cpp/monlib/encode/prometheus')
-rw-r--r-- | library/cpp/monlib/encode/prometheus/prometheus_decoder_ut.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/library/cpp/monlib/encode/prometheus/prometheus_decoder_ut.cpp b/library/cpp/monlib/encode/prometheus/prometheus_decoder_ut.cpp index 9299076f93..72e13a39dd 100644 --- a/library/cpp/monlib/encode/prometheus/prometheus_decoder_ut.cpp +++ b/library/cpp/monlib/encode/prometheus/prometheus_decoder_ut.cpp @@ -68,12 +68,13 @@ Y_UNIT_TEST_SUITE(TPrometheusDecoderTest) { Y_UNIT_TEST(Minimal) { auto samples = Decode( "minimal_metric 1.234\n" + "big_num 1.04671344e+10\n" "another_metric -3e3 103948\n" "# Even that:\n" "no_labels{} 3\n" "# HELP line for non-existing metric will be ignored.\n"); - UNIT_ASSERT_EQUAL(samples.SamplesSize(), 3); + UNIT_ASSERT_EQUAL(samples.SamplesSize(), 4); { auto& s = samples.GetSamples(0); UNIT_ASSERT_EQUAL(s.GetMetricType(), NProto::EMetricType::GAUGE); @@ -84,12 +85,19 @@ Y_UNIT_TEST_SUITE(TPrometheusDecoderTest) { { auto& s = samples.GetSamples(1); UNIT_ASSERT_EQUAL(s.GetMetricType(), NProto::EMetricType::GAUGE); + UNIT_ASSERT_EQUAL(1, s.LabelsSize()); + ASSERT_LABEL_EQUAL(s.GetLabels(0), "sensor", "big_num"); + ASSERT_DOUBLE_POINT(s, TInstant::Zero(), 1.04671344e+10); + } + { + auto& s = samples.GetSamples(2); + UNIT_ASSERT_EQUAL(s.GetMetricType(), NProto::EMetricType::GAUGE); UNIT_ASSERT_EQUAL(s.LabelsSize(), 1); ASSERT_LABEL_EQUAL(s.GetLabels(0), "sensor", "another_metric"); ASSERT_DOUBLE_POINT(s, TInstant::MilliSeconds(103948), -3000.0); } { - auto& s = samples.GetSamples(2); + auto& s = samples.GetSamples(3); UNIT_ASSERT_EQUAL(s.GetMetricType(), NProto::EMetricType::GAUGE); UNIT_ASSERT_EQUAL(1, s.LabelsSize()); ASSERT_LABEL_EQUAL(s.GetLabels(0), "sensor", "no_labels"); |