We add a new format for this, json+, as it generates a lot of data.
As of now, the only difference between json and json+ is the full
dump of all latency bins.
Signed-off-by: Jens Axboe <axboe@fb.com>
--runtime Runtime in seconds
--bandwidth-log Generate per-job bandwidth logs
--minimal Minimal (terse) output
- --output-format=type Output format (terse,json,normal)
+ --output-format=type Output format (terse,json,json+,normal)
--terse-version=type Terse version output format (default 3, or 2 or 4).
--version Print version info and exit
--help Print this page
Write output to \fIfilename\fR.
.TP
.BI \-\-output-format \fR=\fPformat
-Set the reporting format to \fInormal\fR, \fIterse\fR, or \fIjson\fR.
-Multiple formats can be selected, separate by a comma.
+Set the reporting format to \fInormal\fR, \fIterse\fR, \fIjson\fR, or
+\fIjson+\fR. Multiple formats can be selected, separate by a comma. \fIterse\fR
+is a CSV based format. \fIjson+\fR is like \fIjson\fR, except it adds a full
+dump of the latency buckets.
.TP
.BI \-\-runtime \fR=\fPruntime
Limit run time to \fIruntime\fR seconds.
__FIO_OUTPUT_TERSE = 0,
__FIO_OUTPUT_JSON = 1,
__FIO_OUTPUT_NORMAL = 2,
- FIO_OUTPUT_NR = 3,
+ __FIO_OUTPUT_JSON_PLUS = 3,
+ FIO_OUTPUT_NR = 4,
FIO_OUTPUT_TERSE = 1U << __FIO_OUTPUT_TERSE,
FIO_OUTPUT_JSON = 1U << __FIO_OUTPUT_JSON,
FIO_OUTPUT_NORMAL = 1U << __FIO_OUTPUT_NORMAL,
+ FIO_OUTPUT_JSON_PLUS = 1U << __FIO_OUTPUT_JSON_PLUS,
};
enum {
printf(" --runtime\t\tRuntime in seconds\n");
printf(" --bandwidth-log\tGenerate per-job bandwidth logs\n");
printf(" --minimal\t\tMinimal (terse) output\n");
- printf(" --output-format=x\tOutput format (terse,json,normal)\n");
+ printf(" --output-format=x\tOutput format (terse,json,json+,normal)\n");
printf(" --terse-version=x\tSet terse version output format to 'x'\n");
printf(" --version\t\tPrint version info and exit\n");
printf(" --help\t\tPrint this page\n");
output_format |= FIO_OUTPUT_TERSE;
else if (!strcmp(opt, "json"))
output_format |= FIO_OUTPUT_JSON;
+ else if (!strcmp(opt, "json+"))
+ output_format |= (FIO_OUTPUT_JSON | FIO_OUTPUT_JSON_PLUS);
else if (!strcmp(opt, "normal"))
output_format |= FIO_OUTPUT_NORMAL;
else {
unsigned int len, minv, maxv;
int i;
const char *ddirname[] = {"read", "write", "trim"};
- struct json_object *dir_object, *tmp_object, *percentile_object;
+ struct json_object *dir_object, *tmp_object, *percentile_object, *clat_bins_object;
char buf[120];
double p_of_agg = 100.0;
json_object_add_value_int(percentile_object, (const char *)buf, ovals[i]);
}
+ if (output_format & FIO_OUTPUT_JSON_PLUS) {
+ clat_bins_object = json_create_object();
+ json_object_add_value_object(tmp_object, "bins", clat_bins_object);
+ for(i = 0; i < FIO_IO_U_PLAT_NR; i++) {
+ snprintf(buf, sizeof(buf), "%d", i);
+ json_object_add_value_int(clat_bins_object, (const char *)buf, ts->io_u_plat[ddir][i]);
+ }
+ json_object_add_value_int(clat_bins_object, "FIO_IO_U_PLAT_BITS", FIO_IO_U_PLAT_BITS);
+ json_object_add_value_int(clat_bins_object, "FIO_IO_U_PLAT_VAL", FIO_IO_U_PLAT_VAL);
+ json_object_add_value_int(clat_bins_object, "FIO_IO_U_PLAT_NR", FIO_IO_U_PLAT_NR);
+ }
+
if (!calc_lat(&ts->lat_stat[ddir], &min, &max, &mean, &dev)) {
min = max = 0;
mean = dev = 0.0;