summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsueloverso <sue@mongodb.com>2015-12-02 19:24:39 -0500
committersueloverso <sue@mongodb.com>2015-12-02 19:24:39 -0500
commitc1013cee062e74b8c3844489563373907264360c (patch)
tree88741d0557830779b14d9829ecc104322a5ba544
parentfb7fc2f35e887f804223692c7305e6059a2a476a (diff)
parentd04d2ba924e8874979057177ea2331d9374145f8 (diff)
downloadmongo-c1013cee062e74b8c3844489563373907264360c.tar.gz
Merge pull request #2357 from wiredtiger/throttle-2256
WT-2256 Fix interval timer for wtperf throttling.
-rw-r--r--bench/wtperf/wtperf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c
index 9ac96862fa1..899e5fd2887 100644
--- a/bench/wtperf/wtperf.c
+++ b/bench/wtperf/wtperf.c
@@ -2427,6 +2427,11 @@ worker_throttle(int64_t throttle, int64_t *ops, struct timespec *interval)
if (usecs_to_complete < USEC_PER_SEC)
(void)usleep((useconds_t)(USEC_PER_SEC - usecs_to_complete));
+ /*
+ * After sleeping, set the interval to the current time.
+ */
+ if (__wt_epoch(NULL, &now) != 0)
+ return;
*ops = 0;
*interval = now;
}