mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +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()
|
void FairMQBenchmarkSampler::Run()
|
||||||
{
|
{
|
||||||
// std::thread resetMsgCounter(&FairMQBenchmarkSampler::ResetMsgCounter, this);
|
std::thread resetMsgCounter(&FairMQBenchmarkSampler::ResetMsgCounter, this);
|
||||||
|
|
||||||
uint64_t numSentMsgs = 0;
|
uint64_t numSentMsgs = 0;
|
||||||
|
|
||||||
|
@ -96,18 +96,19 @@ void FairMQBenchmarkSampler::Run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --fMsgCounter;
|
--fMsgCounter;
|
||||||
|
|
||||||
// while (fMsgCounter == 0) {
|
while (fMsgCounter == 0)
|
||||||
// this_thread::sleep_for(chrono::milliseconds(1));
|
{
|
||||||
// }
|
this_thread::sleep_for(chrono::milliseconds(1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tEnd = chrono::high_resolution_clock::now();
|
auto tEnd = chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
LOG(INFO) << "Leaving RUNNING state. Sent " << numSentMsgs << " messages in " << chrono::duration<double, milli>(tEnd - tStart).count() << "ms.";
|
LOG(INFO) << "Leaving RUNNING state. Sent " << numSentMsgs << " messages in " << chrono::duration<double, milli>(tEnd - tStart).count() << "ms.";
|
||||||
|
|
||||||
// resetMsgCounter.join();
|
resetMsgCounter.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FairMQBenchmarkSampler::ResetMsgCounter()
|
void FairMQBenchmarkSampler::ResetMsgCounter()
|
||||||
|
@ -117,4 +118,5 @@ void FairMQBenchmarkSampler::ResetMsgCounter()
|
||||||
fMsgCounter = fMsgRate / 100;
|
fMsgCounter = fMsgRate / 100;
|
||||||
this_thread::sleep_for(chrono::milliseconds(10));
|
this_thread::sleep_for(chrono::milliseconds(10));
|
||||||
}
|
}
|
||||||
|
fMsgCounter = -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user