diff options
author | Alexander Smirnov <alex@ydb.tech> | 2025-01-22 00:22:18 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2025-01-22 00:22:18 +0000 |
commit | 47763d31b221c4f827cfb2d3dec8c0a23489fccc (patch) | |
tree | ead46596168eae5e9d38b6e8b770456acaf69ec9 /library/cpp/monlib/encode | |
parent | f64d8ea3633ca6e8062dd5cd795e72f107353854 (diff) | |
parent | fbaf25eeb4ece3eafbc5f111ff230d1124b86cab (diff) | |
download | ydb-47763d31b221c4f827cfb2d3dec8c0a23489fccc.tar.gz |
Merge branch 'rightlib' into merge-libs-250122-0020
Diffstat (limited to 'library/cpp/monlib/encode')
-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"); |