From: Jens Axboe Date: Mon, 20 Aug 2012 12:44:22 +0000 (+0200) Subject: eta: make CR= display more easy to understand X-Git-Tag: fio-2.0.9~2 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=242c38db2cabd0f00bbe37a053c62da07ba345a4 eta: make CR= display more easy to understand 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 --- diff --git a/eta.c b/eta.c index 91145950..552845d8 100644 --- 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++;