summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/execution_control/throughput_probing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage/execution_control/throughput_probing.cpp')
-rw-r--r--src/mongo/db/storage/execution_control/throughput_probing.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/storage/execution_control/throughput_probing.cpp b/src/mongo/db/storage/execution_control/throughput_probing.cpp
index 67201bd9032..d18ed17dd73 100644
--- a/src/mongo/db/storage/execution_control/throughput_probing.cpp
+++ b/src/mongo/db/storage/execution_control/throughput_probing.cpp
@@ -111,6 +111,12 @@ void ThroughputProbing::_run(Client* client) {
}
double elapsed = _timer.micros();
+ if (elapsed == 0) {
+ // The clock used to sleep between iterations may not be reliable, and thus the timer may
+ // report that no time has elapsed. If this occurs, just wait for the next iteration.
+ return;
+ }
+
auto throughput = (numFinishedProcessing - _prevNumFinishedProcessing) / elapsed;
_stats.opsPerSec.store(throughput * 1'000'000);