Add ramp_time option
Sometimes it's useful to let a job settle for a little while
before taking any measurements on latency and throughput, since
the initial rate on eg a write workload may be much higher than
the longer sustained rate.
So add a ramp_time option that allows the user to specify a lead
ramp time that must have passed before fio takes any performance
numbers into account.
Suggested by "Jenkins, Lee" <Lee.Jenkins@hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/time.c b/time.c
index 505058f..4f1c13a 100644
--- a/time.c
+++ b/time.c
@@ -164,6 +164,23 @@
return mtime_since_now(&genesis);
}
+int ramp_time_over(struct thread_data *td)
+{
+ struct timeval tv;
+
+ if (!td->o.ramp_time || td->ramp_time_over)
+ return 1;
+
+ fio_gettime(&tv, NULL);
+ if (mtime_since(&td->epoch, &tv) >= td->o.ramp_time * 1000) {
+ td->ramp_time_over = 1;
+ memcpy(&td->start, &tv, sizeof(tv));
+ return 1;
+ }
+
+ return 0;
+}
+
static void fio_init time_init(void)
{
int i;