Don't do huge tail latencies for network requests when speed up simulation is set

This commit is contained in:
Josh Slocum 2022-04-27 15:03:35 -05:00
parent 333aadb903
commit 1e567c12e8
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ private:
double halfLatency() const {
double a = deterministicRandom()->random01();
const double pFast = 0.999;
if (a <= pFast) {
if (a <= pFast || g_simulator.speedUpSimulation) {
a = a / pFast;
return 0.5 * (FLOW_KNOBS->MIN_NETWORK_LATENCY * (1 - a) +
FLOW_KNOBS->FAST_NETWORK_LATENCY / pFast * a); // 0.5ms average