/* Additional output if continue_on_error set - default off*/
if (ts->continue_on_error)
log_info(";%lu;%d", ts->total_err_count, ts->first_error);
- log_info("\n");
/* Additional output if description is set */
if (strlen(ts->description))
log_info(";%s", ts->description);
+
+ log_info("\n");
}
static void show_thread_status_terse(struct thread_stat *ts,
bw = 0;
if (ts->runtime[j]) {
- unsigned long runt;
+ unsigned long runt = ts->runtime[j];
+ unsigned long long kb;
- runt = ts->runtime[j];
- bw = ts->io_bytes[j] / runt;
+ kb = ts->io_bytes[j] / rs->kb_base;
+ bw = kb * 1000 / runt;
}
if (bw < rs->min_bw[j])
rs->min_bw[j] = bw;
}
for (i = 0; i < groupid + 1; i++) {
- unsigned long max_run[2];
-
rs = &runstats[i];
- max_run[0] = rs->max_run[0];
- max_run[1] = rs->max_run[1];
if (rs->max_run[0])
- rs->agg[0] = (rs->io_kb[0] * 1000) / max_run[0];
+ rs->agg[0] = (rs->io_kb[0] * 1000) / rs->max_run[0];
if (rs->max_run[1])
- rs->agg[1] = (rs->io_kb[1] * 1000) / max_run[1];
+ rs->agg[1] = (rs->io_kb[1] * 1000) / rs->max_run[1];
}
/*
else if (!terse_output)
show_disk_util(0);
- free_disk_util();
-
free(runstats);
free(threadstats);
}
spent = mtime_since(&td->bw_sample_time, t);
if (spent < td->o.bw_avg_time)
return;
-
- /*
+
+ /*
* Compute both read and write rates for the interval.
*/
for (ddir = DDIR_READ; ddir <= DDIR_WRITE; ddir++) {
if (spent < td->o.iops_avg_time)
return;
- iops = ((td->this_io_blocks[ddir] - td->stat_io_blocks[ddir]) * 1000) / spent;
+ /*
+ * Compute both read and write rates for the interval.
+ */
+ for (ddir = DDIR_READ; ddir <= DDIR_WRITE; ddir++) {
+ uint64_t delta;
+
+ delta = td->this_io_blocks[ddir] - td->stat_io_blocks[ddir];
+ if (!delta)
+ continue; /* No entries for interval */
- add_stat_sample(&ts->iops_stat[ddir], iops);
+ iops = (delta * 1000) / spent;
+ add_stat_sample(&ts->iops_stat[ddir], iops);
- if (td->iops_log)
- add_log_sample(td, td->iops_log, iops, ddir, 0);
+ if (td->iops_log)
+ add_log_sample(td, td->iops_log, iops, ddir, 0);
+
+ td->stat_io_blocks[ddir] = td->this_io_blocks[ddir];
+ }
fio_gettime(&td->iops_sample_time, NULL);
- td->stat_io_blocks[ddir] = td->this_io_blocks[ddir];
}