From 50e7842c10a925de413d524326af11c90b6f43ba Mon Sep 17 00:00:00 2001 From: Matthew Kotila Date: Tue, 26 Sep 2023 20:29:41 +0000 Subject: [PATCH] Address feedback --- .../perf_analyzer/periodic_concurrency_manager.cc | 13 ++++--------- .../perf_analyzer/periodic_concurrency_manager.h | 2 -- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/c++/perf_analyzer/periodic_concurrency_manager.cc b/src/c++/perf_analyzer/periodic_concurrency_manager.cc index 526e9806e..1a5527b7b 100644 --- a/src/c++/perf_analyzer/periodic_concurrency_manager.cc +++ b/src/c++/perf_analyzer/periodic_concurrency_manager.cc @@ -51,14 +51,6 @@ PeriodicConcurrencyManager::MakeWorker( return worker; }; -void -PeriodicConcurrencyManager::MaybeAddConcurrentRequests() -{ - if (steps_completed_ * concurrency_range_.step < concurrency_range_.end) { - AddConcurrentRequests(concurrency_range_.step); - } -} - void PeriodicConcurrencyManager::AddConcurrentRequests( uint64_t num_concurrent_requests) @@ -89,7 +81,10 @@ PeriodicConcurrencyManager::PeriodCompletedCallback() num_incomplete_periods_--; if (num_incomplete_periods_ == 0) { steps_completed_++; - MaybeAddConcurrentRequests(); + uint64_t num_requests_sent{steps_completed_ * concurrency_range_.step}; + if (num_requests_sent < concurrency_range_.end) { + AddConcurrentRequests(concurrency_range_.step); + } } } diff --git a/src/c++/perf_analyzer/periodic_concurrency_manager.h b/src/c++/perf_analyzer/periodic_concurrency_manager.h index 38c515875..dca2797b7 100644 --- a/src/c++/perf_analyzer/periodic_concurrency_manager.h +++ b/src/c++/perf_analyzer/periodic_concurrency_manager.h @@ -60,8 +60,6 @@ class PeriodicConcurrencyManager : public ConcurrencyManager { std::shared_ptr thread_config) override; - void MaybeAddConcurrentRequests(); - void AddConcurrentRequests(uint64_t num_concurrent_requests); void AddConcurrentRequest(size_t seq_stat_index_offset);