+ fio_gettime(&now, NULL);
+ rate_time = mtime_since(&rate_prev_time, &now);
+
+ if (write_bw_log && rate_time> bw_avg_time) {
+ calc_rate(rate_time, io_bytes, rate_io_bytes, rate);
+ memcpy(&rate_prev_time, &now, sizeof(now));
+ add_agg_sample(rate[DDIR_READ], DDIR_READ);
+ add_agg_sample(rate[DDIR_WRITE], DDIR_WRITE);
+ }
+
+ disp_time = mtime_since(&disp_prev_time, &now);
+ if (disp_time < 1000)
+ return;
+
+ calc_rate(disp_time, io_bytes, disp_io_bytes, rate);
+ memcpy(&disp_prev_time, &now, sizeof(now));
+