eta: make CR= display more easy to understand
authorJens Axboe <axboe@kernel.dk>
Mon, 20 Aug 2012 12:44:22 +0000 (14:44 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 20 Aug 2012 12:44:22 +0000 (14:44 +0200)
Currently we sum up read and write IOPS/BW rates, but that reads
a bit strange when a given workload only does reads OR writes.
The user then thinks that fio mis-parsed the setting, reading
twice as much as expected.

Only sum up for the read OR write side if one direction is given.
For a mixed workload, it's still the sum of both.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
eta.c

diff --git a/eta.c b/eta.c
index 9114595..552845d 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -285,11 +285,18 @@ int calc_thread_status(struct jobs_eta *je, int force)
                    || td->runstate == TD_FSYNCING
                    || td->runstate == TD_PRE_READING) {
                        je->nr_running++;
-                       je->t_rate += td->o.rate[0] + td->o.rate[1];
-                       je->m_rate += td->o.ratemin[0] + td->o.ratemin[1];
-                       je->t_iops += td->o.rate_iops[0] + td->o.rate_iops[1];
-                       je->m_iops += td->o.rate_iops_min[0] +
-                                       td->o.rate_iops_min[1];
+                       if (td_read(td)) {
+                               je->t_rate += td->o.rate[DDIR_READ];
+                               je->t_iops += td->o.rate_iops[DDIR_READ];
+                               je->m_rate += td->o.ratemin[DDIR_READ];
+                               je->m_iops += td->o.rate_iops_min[DDIR_READ];
+                       }
+                       if (td_write(td)) {
+                               je->t_rate += td->o.rate[DDIR_WRITE];
+                               je->t_iops += td->o.rate_iops[DDIR_WRITE];
+                               je->m_rate += td->o.ratemin[DDIR_WRITE];
+                               je->m_iops += td->o.rate_iops_min[DDIR_WRITE];
+                       }
                        je->files_open += td->nr_open_files;
                } else if (td->runstate == TD_RAMP) {
                        je->nr_running++;