X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=eta.c;h=3089e3f3bdff2525e59d52a0af6984eb1e36546a;hp=3c2316284909c88867c5981db71b93918e1ffef6;hb=d23bb327374520295509bbd98912c8091b701a3e;hpb=9cedf16704b71cec33138bb4cf524d3fc9ad338a diff --git a/eta.c b/eta.c index 3c231628..3089e3f3 100644 --- a/eta.c +++ b/eta.c @@ -108,15 +108,15 @@ static int thread_eta(struct thread_data *td, unsigned long elapsed) * if writing, bytes_total will be twice the size. If mixing, * assume a 50/50 split and thus bytes_total will be 50% larger. */ - if (td->verify) { + if (td->o.verify) { if (td_rw(td)) bytes_total = bytes_total * 3 / 2; else bytes_total <<= 1; } - if (td->zone_size && td->zone_skip) - bytes_total /= (td->zone_skip / td->zone_size); + if (td->o.zone_size && td->o.zone_skip) + bytes_total /= (td->o.zone_skip / td->o.zone_size); if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING) { double perc; @@ -128,8 +128,8 @@ static int thread_eta(struct thread_data *td, unsigned long elapsed) eta_sec = (unsigned long) (elapsed * (1.0 / perc)) - elapsed; - if (td->timeout && eta_sec > (td->timeout - elapsed)) - eta_sec = td->timeout - elapsed; + if (td->o.timeout && eta_sec > (td->o.timeout - elapsed)) + eta_sec = td->o.timeout - elapsed; } else if (td->runstate == TD_NOT_CREATED || td->runstate == TD_CREATED || td->runstate == TD_INITIALIZED) { int t_eta = 0, r_eta = 0; @@ -138,11 +138,11 @@ static int thread_eta(struct thread_data *td, unsigned long elapsed) * We can only guess - assume it'll run the full timeout * if given, otherwise assume it'll run at the specified rate. */ - if (td->timeout) - t_eta = td->timeout + td->start_delay - elapsed; - if (td->rate) { - r_eta = (bytes_total / 1024) / td->rate; - r_eta += td->start_delay - elapsed; + if (td->o.timeout) + t_eta = td->o.timeout + td->o.start_delay - elapsed; + if (td->o.rate) { + r_eta = (bytes_total / 1024) / td->o.rate; + r_eta += td->o.start_delay - elapsed; } if (r_eta && t_eta) @@ -180,6 +180,7 @@ void print_thread_status(void) { unsigned long elapsed = mtime_since_genesis() / 1000; int i, nr_running, nr_pending, t_rate, m_rate, *eta_secs, eta_sec; + int t_iops, m_iops; struct thread_data *td; char eta_str[128]; double perc = 0.0; @@ -204,16 +205,18 @@ void print_thread_status(void) memset(eta_secs, 0, thread_number * sizeof(int)); io_bytes[0] = io_bytes[1] = 0; - nr_pending = nr_running = t_rate = m_rate = 0; + nr_pending = nr_running = t_rate = m_rate = t_iops = m_iops = 0; bw_avg_time = ULONG_MAX; for_each_td(td, i) { - if (td->bw_avg_time < bw_avg_time) - bw_avg_time = td->bw_avg_time; + if (td->o.bw_avg_time < bw_avg_time) + bw_avg_time = td->o.bw_avg_time; if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING || td->runstate == TD_FSYNCING) { nr_running++; - t_rate += td->rate; - m_rate += td->ratemin; + t_rate += td->o.rate; + m_rate += td->o.ratemin; + t_iops += td->o.rate_iops; + m_iops += td->o.rate_iops_min; } else if (td->runstate < TD_RUNNING) nr_pending++; @@ -272,6 +275,8 @@ void print_thread_status(void) printf("Jobs: %d", nr_running); if (m_rate || t_rate) printf(", CR=%d/%d KiB/s", t_rate, m_rate); + else if (m_iops || t_iops) + printf(", CR=%d/%d IOPS", t_iops, m_iops); if (eta_sec != INT_MAX && nr_running) { perc *= 100.0; printf(": [%s] [%3.1f%% done] [%6u/%6u kb/s] [eta %s]", run_str, perc, rate[0], rate[1], eta_str);