diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
commit | 8cbc307de0221f84c80c42dcbe07d40727537e2c (patch) | |
tree | 625d5a673015d1df891e051033e9fcde5c7be4e5 /library/cpp/histogram/hdr | |
parent | 30d1ef3941e0dc835be7609de5ebee66958f215a (diff) | |
download | ydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/histogram/hdr')
-rw-r--r-- | library/cpp/histogram/hdr/histogram_iter_ut.cpp | 16 | ||||
-rw-r--r-- | library/cpp/histogram/hdr/histogram_ut.cpp | 20 |
2 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/histogram/hdr/histogram_iter_ut.cpp b/library/cpp/histogram/hdr/histogram_iter_ut.cpp index 9c291a2547..2d6ffc68d9 100644 --- a/library/cpp/histogram/hdr/histogram_iter_ut.cpp +++ b/library/cpp/histogram/hdr/histogram_iter_ut.cpp @@ -4,8 +4,8 @@ using namespace NHdr; -Y_UNIT_TEST_SUITE(THistogramIterTest) { - Y_UNIT_TEST(RecordedValues) { +Y_UNIT_TEST_SUITE(THistogramIterTest) { + Y_UNIT_TEST(RecordedValues) { THistogram h(TDuration::Hours(1).MicroSeconds(), 3); UNIT_ASSERT(h.RecordValues(1000, 1000)); UNIT_ASSERT(h.RecordValue(1000 * 1000)); @@ -32,7 +32,7 @@ Y_UNIT_TEST_SUITE(THistogramIterTest) { UNIT_ASSERT_EQUAL(index, 2); } - Y_UNIT_TEST(CorrectedRecordedValues) { + Y_UNIT_TEST(CorrectedRecordedValues) { THistogram h(TDuration::Hours(1).MicroSeconds(), 3); UNIT_ASSERT(h.RecordValuesWithExpectedInterval(1000, 1000, 1000)); UNIT_ASSERT(h.RecordValueWithExpectedInterval(1000 * 1000, 1000)); @@ -59,7 +59,7 @@ Y_UNIT_TEST_SUITE(THistogramIterTest) { UNIT_ASSERT_EQUAL(totalCount, 2000); } - Y_UNIT_TEST(LinearValues) { + Y_UNIT_TEST(LinearValues) { THistogram h(TDuration::Hours(1).MicroSeconds(), 3); UNIT_ASSERT(h.RecordValues(1000, 1000)); UNIT_ASSERT(h.RecordValue(1000 * 1000)); @@ -87,7 +87,7 @@ Y_UNIT_TEST_SUITE(THistogramIterTest) { UNIT_ASSERT_EQUAL(index, 1000); } - Y_UNIT_TEST(CorrectLinearValues) { + Y_UNIT_TEST(CorrectLinearValues) { THistogram h(TDuration::Hours(1).MicroSeconds(), 3); UNIT_ASSERT(h.RecordValuesWithExpectedInterval(1000, 1000, 1000)); UNIT_ASSERT(h.RecordValueWithExpectedInterval(1000 * 1000, 1000)); @@ -116,7 +116,7 @@ Y_UNIT_TEST_SUITE(THistogramIterTest) { UNIT_ASSERT_EQUAL(totalCount, 2000); } - Y_UNIT_TEST(LogarithmicValues) { + Y_UNIT_TEST(LogarithmicValues) { THistogram h(TDuration::Hours(1).MicroSeconds(), 3); UNIT_ASSERT(h.RecordValues(1000, 1000)); UNIT_ASSERT(h.RecordValue(1000 * 1000)); @@ -150,7 +150,7 @@ Y_UNIT_TEST_SUITE(THistogramIterTest) { UNIT_ASSERT_EQUAL(index, 11); } - Y_UNIT_TEST(CorrectedLogarithmicValues) { + Y_UNIT_TEST(CorrectedLogarithmicValues) { THistogram h(TDuration::Hours(1).MicroSeconds(), 3); UNIT_ASSERT(h.RecordValuesWithExpectedInterval(1000, 1000, 1000)); UNIT_ASSERT(h.RecordValueWithExpectedInterval(1000 * 1000, 1000)); @@ -181,7 +181,7 @@ Y_UNIT_TEST_SUITE(THistogramIterTest) { UNIT_ASSERT_EQUAL(totalCount, 2000); } - Y_UNIT_TEST(LinearIterBucketsCorrectly) { + Y_UNIT_TEST(LinearIterBucketsCorrectly) { THistogram h(255, 2); UNIT_ASSERT(h.RecordValue(193)); UNIT_ASSERT(h.RecordValue(255)); diff --git a/library/cpp/histogram/hdr/histogram_ut.cpp b/library/cpp/histogram/hdr/histogram_ut.cpp index 4841b76e71..8974e60e2b 100644 --- a/library/cpp/histogram/hdr/histogram_ut.cpp +++ b/library/cpp/histogram/hdr/histogram_ut.cpp @@ -16,14 +16,14 @@ void LoadData(THistogram* h1, THistogram* h2) { UNIT_ASSERT(h2->RecordValueWithExpectedInterval(1000 * 1000, 1000)); } -Y_UNIT_TEST_SUITE(THistogramTest) { - Y_UNIT_TEST(Creation) { +Y_UNIT_TEST_SUITE(THistogramTest) { + Y_UNIT_TEST(Creation) { THistogram h(TDuration::Hours(1).MicroSeconds(), 3); UNIT_ASSERT_EQUAL(h.GetMemorySize(), 188512); UNIT_ASSERT_EQUAL(h.GetCountsLen(), 23552); } - Y_UNIT_TEST(CreateWithLargeValues) { + Y_UNIT_TEST(CreateWithLargeValues) { THistogram h(20L * 1000 * 1000, 100L * 1000 * 1000, 5); UNIT_ASSERT(h.RecordValue(100L * 1000 * 1000)); UNIT_ASSERT(h.RecordValue(20L * 1000 * 1000)); @@ -45,18 +45,18 @@ Y_UNIT_TEST_SUITE(THistogramTest) { UNIT_ASSERT(h.ValuesAreEqual(v99, 100L * 1000 * 1000)); } - Y_UNIT_TEST(InvalidSignificantValueDigits) { + Y_UNIT_TEST(InvalidSignificantValueDigits) { UNIT_ASSERT_EXCEPTION(THistogram(1000, -1), yexception); UNIT_ASSERT_EXCEPTION(THistogram(1000, 0), yexception); UNIT_ASSERT_EXCEPTION(THistogram(1000, 6), yexception); } - Y_UNIT_TEST(InvalidLowestDiscernibleValue) { + Y_UNIT_TEST(InvalidLowestDiscernibleValue) { UNIT_ASSERT_EXCEPTION(THistogram(0, 100, 3), yexception); UNIT_ASSERT_EXCEPTION(THistogram(110, 100, 3), yexception); } - Y_UNIT_TEST(TotalCount) { + Y_UNIT_TEST(TotalCount) { i64 oneHour = SafeIntegerCast<i64>(TDuration::Hours(1).MicroSeconds()); THistogram h1(oneHour, 3); THistogram h2(oneHour, 3); @@ -66,7 +66,7 @@ Y_UNIT_TEST_SUITE(THistogramTest) { UNIT_ASSERT_EQUAL(h2.GetTotalCount(), 2000); } - Y_UNIT_TEST(StatsValues) { + Y_UNIT_TEST(StatsValues) { i64 oneHour = SafeIntegerCast<i64>(TDuration::Hours(1).MicroSeconds()); THistogram h1(oneHour, 3); THistogram h2(oneHour, 3); @@ -97,7 +97,7 @@ Y_UNIT_TEST_SUITE(THistogramTest) { } } - Y_UNIT_TEST(Percentiles) { + Y_UNIT_TEST(Percentiles) { i64 oneHour = SafeIntegerCast<i64>(TDuration::Hours(1).MicroSeconds()); THistogram h1(oneHour, 3); THistogram h2(oneHour, 3); @@ -156,13 +156,13 @@ Y_UNIT_TEST_SUITE(THistogramTest) { } } - Y_UNIT_TEST(OutOfRangeValues) { + Y_UNIT_TEST(OutOfRangeValues) { THistogram h(1000, 4); UNIT_ASSERT(h.RecordValue(32767)); UNIT_ASSERT(!h.RecordValue(32768)); } - Y_UNIT_TEST(Reset) { + Y_UNIT_TEST(Reset) { THistogram h(TDuration::Hours(1).MicroSeconds(), 3); UNIT_ASSERT(h.RecordValues(1000, 1000)); UNIT_ASSERT(h.RecordValue(1000 * 1000)); |