Recalculate rate in each iteration of testClient

This commit is contained in:
sfc-gh-tclinkenbeard 2022-06-15 19:12:25 -07:00
parent 9179382fc3
commit bef2f5dfaf
1 changed files with 3 additions and 5 deletions

View File

@ -305,11 +305,9 @@ ACTOR static Future<Void> testClient(GlobalTagThrottler* globalTagThrottler,
loop {
auto tpsLimit = testGetTPSLimit(*globalTagThrottler, tag);
state double tpsRate = tpsLimit.present() ? std::min<double>(desiredTpsRate, tpsLimit.get()) : desiredTpsRate;
loop {
wait(delay(1 / tpsRate));
testStorageServers->addReadCost(tag, costPerTransaction);
globalTagThrottler->addRequests(tag, 1);
}
wait(delay(1 / tpsRate));
testStorageServers->addReadCost(tag, costPerTransaction);
globalTagThrottler->addRequests(tag, 1);
}
}