diff options
author | kbalakirev <kbalakirev@yandex-team.ru> | 2022-02-10 16:48:58 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:58 +0300 |
commit | 498a47e48d41e5ec64ee3aa622a76a80274f35bd (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/monlib/metrics/log_histogram_collector_ut.cpp | |
parent | 1906a186042870fd03a12180acd1a6fcee045e42 (diff) | |
download | ydb-498a47e48d41e5ec64ee3aa622a76a80274f35bd.tar.gz |
Restoring authorship annotation for <kbalakirev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/monlib/metrics/log_histogram_collector_ut.cpp')
-rw-r--r-- | library/cpp/monlib/metrics/log_histogram_collector_ut.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/library/cpp/monlib/metrics/log_histogram_collector_ut.cpp b/library/cpp/monlib/metrics/log_histogram_collector_ut.cpp index 560ec83714..ac9a3522ce 100644 --- a/library/cpp/monlib/metrics/log_histogram_collector_ut.cpp +++ b/library/cpp/monlib/metrics/log_histogram_collector_ut.cpp @@ -1,38 +1,38 @@ -#include "log_histogram_collector.h" - -#include <library/cpp/testing/unittest/registar.h> - -Y_UNIT_TEST_SUITE(LogHistogramCollector) { - - Y_UNIT_TEST(ExtendUpEmpty) { - NMonitoring::TLogHistogramCollector collector(-1); - collector.Collect(4.1944122207138854e+17); - auto s = collector.Snapshot(); - UNIT_ASSERT_EQUAL(s->ZerosCount(), 0); - UNIT_ASSERT_EQUAL(s->StartPower(), 1); - UNIT_ASSERT_EQUAL(s->Count(), 100); - UNIT_ASSERT_EQUAL(s->Bucket(s->Count() - 1), 1); - } - - Y_UNIT_TEST(ExtendUpNonEmpty) { - NMonitoring::TLogHistogramCollector collector(-1); - collector.Collect(0.0); - collector.Collect(1/(1.5*1.5*1.5)); - collector.Collect(1/1.5); - auto s = collector.Snapshot(); - - UNIT_ASSERT_EQUAL(s->ZerosCount(), 1); - UNIT_ASSERT_EQUAL(s->StartPower(), -4); - UNIT_ASSERT_EQUAL(s->Count(), 3); - UNIT_ASSERT_EQUAL(s->Bucket(1), 1); - UNIT_ASSERT_EQUAL(s->Bucket(2), 1); - - collector.Collect(4.1944122207138854e+17); - s = collector.Snapshot(); - UNIT_ASSERT_EQUAL(s->ZerosCount(), 1); - UNIT_ASSERT_EQUAL(s->StartPower(), 1); - UNIT_ASSERT_EQUAL(s->Count(), 100); - UNIT_ASSERT_EQUAL(s->Bucket(0), 2); - UNIT_ASSERT_EQUAL(s->Bucket(99), 1); - } -} +#include "log_histogram_collector.h" + +#include <library/cpp/testing/unittest/registar.h> + +Y_UNIT_TEST_SUITE(LogHistogramCollector) { + + Y_UNIT_TEST(ExtendUpEmpty) { + NMonitoring::TLogHistogramCollector collector(-1); + collector.Collect(4.1944122207138854e+17); + auto s = collector.Snapshot(); + UNIT_ASSERT_EQUAL(s->ZerosCount(), 0); + UNIT_ASSERT_EQUAL(s->StartPower(), 1); + UNIT_ASSERT_EQUAL(s->Count(), 100); + UNIT_ASSERT_EQUAL(s->Bucket(s->Count() - 1), 1); + } + + Y_UNIT_TEST(ExtendUpNonEmpty) { + NMonitoring::TLogHistogramCollector collector(-1); + collector.Collect(0.0); + collector.Collect(1/(1.5*1.5*1.5)); + collector.Collect(1/1.5); + auto s = collector.Snapshot(); + + UNIT_ASSERT_EQUAL(s->ZerosCount(), 1); + UNIT_ASSERT_EQUAL(s->StartPower(), -4); + UNIT_ASSERT_EQUAL(s->Count(), 3); + UNIT_ASSERT_EQUAL(s->Bucket(1), 1); + UNIT_ASSERT_EQUAL(s->Bucket(2), 1); + + collector.Collect(4.1944122207138854e+17); + s = collector.Snapshot(); + UNIT_ASSERT_EQUAL(s->ZerosCount(), 1); + UNIT_ASSERT_EQUAL(s->StartPower(), 1); + UNIT_ASSERT_EQUAL(s->Count(), 100); + UNIT_ASSERT_EQUAL(s->Bucket(0), 2); + UNIT_ASSERT_EQUAL(s->Bucket(99), 1); + } +} |