Merge branch 'fix_bytesrate_eta' of https://github.com/PCPartPicker/fio
authorJens Axboe <axboe@kernel.dk>
Tue, 15 Feb 2022 19:22:31 +0000 (12:22 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 15 Feb 2022 19:22:31 +0000 (12:22 -0700)
* 'fix_bytesrate_eta' of https://github.com/PCPartPicker/fio:
  Fix ETA display when rate and/or rate_min are specified

eta.c

diff --git a/eta.c b/eta.c
index ea1781f3b792147636210f38714abb089870a2da..17970c78dbfd94261403b6c67c536e875ad65fdb 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -420,6 +420,7 @@ bool calc_thread_status(struct jobs_eta *je, int force)
                if (is_power_of_2(td->o.kb_base))
                        je->is_pow2 = 1;
                je->unit_base = td->o.unit_base;
+               je->sig_figs = td->o.sig_figs;
                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
@@ -600,9 +601,9 @@ void display_thread_status(struct jobs_eta *je)
                char *tr, *mr;
 
                mr = num2str(je->m_rate[0] + je->m_rate[1] + je->m_rate[2],
-                               je->sig_figs, 0, je->is_pow2, N2S_BYTEPERSEC);
+                               je->sig_figs, 1, je->is_pow2, N2S_BYTEPERSEC);
                tr = num2str(je->t_rate[0] + je->t_rate[1] + je->t_rate[2],
-                               je->sig_figs, 0, je->is_pow2, N2S_BYTEPERSEC);
+                               je->sig_figs, 1, je->is_pow2, N2S_BYTEPERSEC);
 
                p += sprintf(p, ", %s-%s", mr, tr);
                free(tr);