- mtime = mtime_since_now(&prev_time);
- if (mtime > bw_avg_time) {
- r_rate = (io_bytes[0] - prev_io_bytes[0]) / mtime;
- w_rate = (io_bytes[1] - prev_io_bytes[1]) / mtime;
- fio_gettime(&prev_time, NULL);
- if (write_bw_log) {
- add_agg_sample(r_rate, DDIR_READ);
- add_agg_sample(w_rate, DDIR_WRITE);
- }
- memcpy(prev_io_bytes, io_bytes, sizeof(io_bytes));
+ disp_time = mtime_since(&disp_prev_time, &now);
+
+ /*
+ * Allow a little slack, the target is to print it every 1000 msecs
+ */
+ if (!force && disp_time < 900)
+ return 0;
+
+ calc_rate(disp_time, io_bytes, disp_io_bytes, je->rate);
+ calc_iops(disp_time, io_iops, disp_io_iops, je->iops);
+
+ memcpy(&disp_prev_time, &now, sizeof(now));
+
+ if (!force && !je->nr_running && !je->nr_pending)
+ return 0;
+
+ je->nr_threads = thread_number;
+ memcpy(je->run_str, run_str, thread_number * sizeof(char));
+
+ return 1;
+}
+
+void display_thread_status(struct jobs_eta *je)
+{
+ static int linelen_last;
+ static int eta_good;
+ char output[512], *p = output;
+ char eta_str[128];
+ double perc = 0.0;
+ int i2p = 0;
+
+ if (je->eta_sec != INT_MAX && je->elapsed_sec) {
+ perc = (double) je->elapsed_sec / (double) (je->elapsed_sec + je->eta_sec);
+ eta_to_str(eta_str, je->eta_sec);