eta: Fix ramp time ETA
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 27 Nov 2016 17:13:27 +0000 (17:13 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 27 Nov 2016 21:40:26 +0000 (21:40 +0000)
Ramp time ETA in thread_eta() was was assuming all rate directions were
being used and that bytes_total was in kilobytes.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
eta.c

diff --git a/eta.c b/eta.c
index c2c9d4e8fb79bb9cc74abe0cad0294f30b426c5e..fe7b1e005301ae7741a4b07aa341d7bcde1842d3 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -259,9 +259,16 @@ static unsigned long thread_eta(struct thread_data *td)
                                        t_eta -= ramp_left;
                        }
                }
-               rate_bytes = ddir_rw_sum(td->o.rate);
+               rate_bytes = 0;
+               if (td_read(td))
+                       rate_bytes  = td->o.rate[DDIR_READ];
+               if (td_write(td))
+                       rate_bytes += td->o.rate[DDIR_WRITE];
+               if (td_trim(td))
+                       rate_bytes += td->o.rate[DDIR_TRIM];
+
                if (rate_bytes) {
-                       r_eta = (bytes_total / 1024) / rate_bytes;
+                       r_eta = bytes_total / rate_bytes;
                        r_eta += (td->o.start_delay / 1000000ULL);
                }