X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=eta.c;h=39241c5aaf5a529dee695e86ef09c5c17d1efb15;hp=a48cadae70684b43e901a2b9fc18bedf23d42504;hb=fdf287440fa8486f0e96c8597349d5d25e98fb6a;hpb=e6e41602c9725f811160f244b8ec5ecaa4912f45 diff --git a/eta.c b/eta.c index a48cadae..39241c5a 100644 --- a/eta.c +++ b/eta.c @@ -6,7 +6,6 @@ #include #include "fio.h" -#include "os.h" static char run_str[MAX_JOBS + 1]; @@ -119,13 +118,19 @@ static int thread_eta(struct thread_data *td, unsigned long elapsed) bytes_total /= (td->o.zone_skip / td->o.zone_size); if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING) { - double perc; + double perc, perc_t; bytes_done = td->io_bytes[DDIR_READ] + td->io_bytes[DDIR_WRITE]; perc = (double) bytes_done / (double) bytes_total; if (perc > 1.0) perc = 1.0; + if (td->o.time_based) { + perc_t = (double) elapsed / (double) td->o.timeout; + if (perc_t < perc) + perc = perc_t; + } + eta_sec = (unsigned long) (elapsed * (1.0 / perc)) - elapsed; if (td->o.timeout && eta_sec > (td->o.timeout - elapsed))