mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-12 16:21:13 +00:00
Re-enable rate limiting in benchmarkSampler
This commit is contained in:
parent
5aaf27bf02
commit
ac7017deb5
|
@ -48,7 +48,7 @@ void FairMQBenchmarkSampler::InitTask()
|
|||
|
||||
void FairMQBenchmarkSampler::Run()
|
||||
{
|
||||
// std::thread resetMsgCounter(&FairMQBenchmarkSampler::ResetMsgCounter, this);
|
||||
std::thread resetMsgCounter(&FairMQBenchmarkSampler::ResetMsgCounter, this);
|
||||
|
||||
uint64_t numSentMsgs = 0;
|
||||
|
||||
|
@ -96,18 +96,19 @@ void FairMQBenchmarkSampler::Run()
|
|||
}
|
||||
}
|
||||
|
||||
// --fMsgCounter;
|
||||
--fMsgCounter;
|
||||
|
||||
// while (fMsgCounter == 0) {
|
||||
// this_thread::sleep_for(chrono::milliseconds(1));
|
||||
// }
|
||||
while (fMsgCounter == 0)
|
||||
{
|
||||
this_thread::sleep_for(chrono::milliseconds(1));
|
||||
}
|
||||
}
|
||||
|
||||
auto tEnd = chrono::high_resolution_clock::now();
|
||||
|
||||
LOG(INFO) << "Leaving RUNNING state. Sent " << numSentMsgs << " messages in " << chrono::duration<double, milli>(tEnd - tStart).count() << "ms.";
|
||||
|
||||
// resetMsgCounter.join();
|
||||
resetMsgCounter.join();
|
||||
}
|
||||
|
||||
void FairMQBenchmarkSampler::ResetMsgCounter()
|
||||
|
@ -117,4 +118,5 @@ void FairMQBenchmarkSampler::ResetMsgCounter()
|
|||
fMsgCounter = fMsgRate / 100;
|
||||
this_thread::sleep_for(chrono::milliseconds(10));
|
||||
}
|
||||
fMsgCounter = -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user