summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSusan LoVerso <sue@wiredtiger.com>2015-12-02 15:37:12 -0500
committerSusan LoVerso <sue@wiredtiger.com>2015-12-02 15:37:12 -0500
commitd04d2ba924e8874979057177ea2331d9374145f8 (patch)
tree755db553c0c9f90491f727f5b018bc0869b2dd0f
parentbff6525c8382d97221a4d08452aef78ed0b8ea25 (diff)
downloadmongo-d04d2ba924e8874979057177ea2331d9374145f8.tar.gz
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;
}