diff options
author | Alexander Gololobov <davenger@yandex-team.com> | 2022-02-10 16:47:37 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:37 +0300 |
commit | 39608cdb86363c75ce55b2b9a69841c3b71f22cf (patch) | |
tree | 4ec132c1665bd4d68e3628aa18d937c70d32413b /library/cpp/monlib/dynamic_counters/counters_ut.cpp | |
parent | 54295b9bd4dc45c54d804084fd846d945148a7f0 (diff) | |
download | ydb-39608cdb86363c75ce55b2b9a69841c3b71f22cf.tar.gz |
Restoring authorship annotation for Alexander Gololobov <davenger@yandex-team.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/monlib/dynamic_counters/counters_ut.cpp')
-rw-r--r-- | library/cpp/monlib/dynamic_counters/counters_ut.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/library/cpp/monlib/dynamic_counters/counters_ut.cpp b/library/cpp/monlib/dynamic_counters/counters_ut.cpp index 3591037e0a..f3d87930f9 100644 --- a/library/cpp/monlib/dynamic_counters/counters_ut.cpp +++ b/library/cpp/monlib/dynamic_counters/counters_ut.cpp @@ -284,33 +284,33 @@ Y_UNIT_TEST_SUITE(TDynamicCountersTest) { " sensor:timeMillis = {1: 1, 2: 1, 4: 2, inf: 95}\n" "}\n"); } - - Y_UNIT_TEST(CounterLookupCounter) { - TDynamicCounterPtr rootGroup(new TDynamicCounters()); - TDynamicCounters::TCounterPtr lookups = rootGroup->GetCounter("Lookups", true); - rootGroup->SetLookupCounter(lookups); - - // Create subtree and check that counter is inherited - TDynamicCounterPtr serviceGroup = rootGroup->GetSubgroup("service", "MyService"); - UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 1); - - TDynamicCounterPtr subGroup = serviceGroup->GetSubgroup("component", "MyComponent"); - UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 2); - - auto counter = subGroup->GetNamedCounter("range", "20 msec", true); - UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 3); - - auto hist = subGroup->GetHistogram("timeMsec", ExponentialHistogram(4, 2)); - UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 4); - - // Replace the counter for subGroup - auto subGroupLookups = rootGroup->GetCounter("LookupsInMyComponent", true); - UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 5); - subGroup->SetLookupCounter(subGroupLookups); - auto counter2 = subGroup->GetNamedCounter("range", "30 msec", true); - UNIT_ASSERT_VALUES_EQUAL(subGroupLookups->Val(), 1); - UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 5); - } + + Y_UNIT_TEST(CounterLookupCounter) { + TDynamicCounterPtr rootGroup(new TDynamicCounters()); + TDynamicCounters::TCounterPtr lookups = rootGroup->GetCounter("Lookups", true); + rootGroup->SetLookupCounter(lookups); + + // Create subtree and check that counter is inherited + TDynamicCounterPtr serviceGroup = rootGroup->GetSubgroup("service", "MyService"); + UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 1); + + TDynamicCounterPtr subGroup = serviceGroup->GetSubgroup("component", "MyComponent"); + UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 2); + + auto counter = subGroup->GetNamedCounter("range", "20 msec", true); + UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 3); + + auto hist = subGroup->GetHistogram("timeMsec", ExponentialHistogram(4, 2)); + UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 4); + + // Replace the counter for subGroup + auto subGroupLookups = rootGroup->GetCounter("LookupsInMyComponent", true); + UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 5); + subGroup->SetLookupCounter(subGroupLookups); + auto counter2 = subGroup->GetNamedCounter("range", "30 msec", true); + UNIT_ASSERT_VALUES_EQUAL(subGroupLookups->Val(), 1); + UNIT_ASSERT_VALUES_EQUAL(lookups->Val(), 5); + } Y_UNIT_TEST(FindCounters) { TDynamicCounterPtr rootGroup(new TDynamicCounters()); |