time_width = max(5, (int) (log10(maxv / divisor) + 1));
- snprintf(fmt, sizeof(fmt), " %%%u.%ufth=[%%%dllu]%%c", precision+3, precision, time_width);
- // fmt will be something like " %5.2fth=[%4llu]%c"
+ snprintf(fmt, sizeof(fmt), " %%%u.%ufth=[%%%dllu]%%c", precision + 3,
+ precision, time_width);
+ /* fmt will be something like " %5.2fth=[%4llu]%c" */
per_line = (80 - 7) / (precision + 10 + time_width);
for (j = 0; j < len; j++) {
free(ovals);
}
-bool calc_lat(struct io_stat *is, unsigned long long *min, unsigned long long *max,
- double *mean, double *dev)
+bool calc_lat(struct io_stat *is, unsigned long long *min,
+ unsigned long long *max, double *mean, double *dev)
{
double n = (double) is->samples;
}
}
+/*
+ * To keep the terse format unaltered, add all of the ns latency
+ * buckets to the first us latency bucket
+ */
+void stat_calc_lat_nu(struct thread_stat *ts, double *io_u_lat_u)
+{
+ unsigned long ntotal = 0, total = ddir_rw_sum(ts->total_io_u);
+ int i;
+
+ stat_calc_lat(ts, io_u_lat_u, ts->io_u_lat_u, FIO_IO_U_LAT_U_NR);
+
+ for (i = 0; i < FIO_IO_U_LAT_N_NR; i++)
+ ntotal += ts->io_u_lat_n[i];
+
+ io_u_lat_u[0] += 100.0 * (double) ntotal / (double) total;
+}
+
void stat_calc_lat_n(struct thread_stat *ts, double *io_u_lat)
{
stat_calc_lat(ts, io_u_lat, ts->io_u_lat_n, FIO_IO_U_LAT_N_NR);
stat_calc_lat(ts, io_u_lat, ts->io_u_lat_m, FIO_IO_U_LAT_M_NR);
}
-static void display_lat(const char *name, unsigned long long min, unsigned long long max,
- double mean, double dev, struct buf_output *out)
+static void display_lat(const char *name, unsigned long long min,
+ unsigned long long max, double mean, double dev,
+ struct buf_output *out)
{
const char *base = "(nsec)";
char *minp, *maxp;
(unsigned long long) ts->runtime[ddir]);
if (calc_lat(&ts->slat_stat[ddir], &min, &max, &mean, &dev))
- log_buf(out, ";%llu;%llu;%f;%f", min, max, mean, dev);
+ log_buf(out, ";%llu;%llu;%f;%f", min/1000, max/1000, mean/1000, dev/1000);
else
log_buf(out, ";%llu;%llu;%f;%f", 0ULL, 0ULL, 0.0, 0.0);
if (calc_lat(&ts->clat_stat[ddir], &min, &max, &mean, &dev))
- log_buf(out, ";%llu;%llu;%f;%f", min, max, mean, dev);
+ log_buf(out, ";%llu;%llu;%f;%f", min/1000, max/1000, mean/1000, dev/1000);
else
log_buf(out, ";%llu;%llu;%f;%f", 0ULL, 0ULL, 0.0, 0.0);
log_buf(out, ";0%%=0");
continue;
}
- log_buf(out, ";%f%%=%llu", ts->percentile_list[i].u.f, ovals[i]);
+ log_buf(out, ";%f%%=%llu", ts->percentile_list[i].u.f, ovals[i]/1000);
}
if (calc_lat(&ts->lat_stat[ddir], &min, &max, &mean, &dev))
- log_buf(out, ";%llu;%llu;%f;%f", min, max, mean, dev);
+ log_buf(out, ";%llu;%llu;%f;%f", min/1000, max/1000, mean/1000, dev/1000);
else
log_buf(out, ";%llu;%llu;%f;%f", 0ULL, 0ULL, 0.0, 0.0);
/* Calc % distribution of IO depths, usecond, msecond latency */
stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist);
- stat_calc_lat_u(ts, io_u_lat_u);
+ stat_calc_lat_nu(ts, io_u_lat_u);
stat_calc_lat_m(ts, io_u_lat_m);
/* Only show fixed 7 I/O depth levels*/
/* Calc % distribution of IO depths, usecond, msecond latency */
stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist);
- stat_calc_lat_u(ts, io_u_lat_u);
+ stat_calc_lat_nu(ts, io_u_lat_u);
stat_calc_lat_m(ts, io_u_lat_m);
/* Only show fixed 7 I/O depth levels*/