Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NBSDUTY-214: fix ShouldReportSufferMetrics test (add warmup timer) #2827

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cloud/blockstore/libs/diagnostics/volume_stats_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <library/cpp/monlib/dynamic_counters/counters.h>
#include <library/cpp/monlib/metrics/metric_consumer.h>
#include <library/cpp/monlib/metrics/metric_registry.h>
#include <library/cpp/testing/hook/hook.h>
#include <library/cpp/testing/unittest/registar.h>

#include <util/datetime/cputimer.h>
Expand Down Expand Up @@ -83,6 +84,12 @@ void Mount(

Y_UNIT_TEST_SUITE(TVolumeStatsTest)
{
Y_TEST_HOOK_BEFORE_RUN(InitTest)
{
// NHPTimer warmup, see issue #2830 for more information
Y_UNUSED(GetCyclesPerMillisecond());
}

Y_UNIT_TEST(ShouldTrackRequestsPerVolume)
{
auto monitoring = CreateMonitoringServiceStub();
Expand Down
13 changes: 7 additions & 6 deletions cloud/storage/core/libs/diagnostics/request_counters_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "cloud/storage/core/libs/diagnostics/histogram_types.h"

#include <library/cpp/monlib/dynamic_counters/counters.h>
#include <library/cpp/testing/hook/hook.h>
#include <library/cpp/testing/unittest/registar.h>

#include <util/datetime/cputimer.h>
Expand Down Expand Up @@ -131,6 +132,12 @@ auto MakeRequestCountersPtr(

Y_UNIT_TEST_SUITE(TRequestCountersTest)
{
Y_TEST_HOOK_BEFORE_RUN(InitTest)
{
// NHPTimer warmup, see issue #2830 for more information
Y_UNUSED(GetCyclesPerMillisecond());
}

Y_UNIT_TEST(ShouldTrackRequestsInProgress)
{
auto monitoring = CreateMonitoringServiceStub();
Expand Down Expand Up @@ -681,9 +688,6 @@ Y_UNIT_TEST_SUITE(TRequestCountersTest)

Y_UNIT_TEST(ShouldReportHistogramAsMultipleSensors)
dvrazumov marked this conversation as resolved.
Show resolved Hide resolved
{
auto warmupTimer = GetCyclesPerMillisecond();
Y_UNUSED(warmupTimer);

auto monitoring = CreateMonitoringServiceStub();
auto counters = MakeRequestCountersPtr(
TRequestCounters::EOption::ReportDataPlaneHistogram,
Expand Down Expand Up @@ -722,9 +726,6 @@ Y_UNIT_TEST_SUITE(TRequestCountersTest)

Y_UNIT_TEST(ShouldReportHistogramAsSingleSensor)
{
auto warmupTimer = GetCyclesPerMillisecond();
Y_UNUSED(warmupTimer);

auto monitoring = CreateMonitoringServiceStub();
auto counters = MakeRequestCountersPtr(
TRequestCounters::EOption::ReportDataPlaneHistogram,
Expand Down
Loading