axboe / fio

Flexible I/O Tester
GNU General Public License v2.0
5.23k stars 1.26k forks source link

Fio not giving proper json format output #672

Open jo-ale35 opened 6 years ago

jo-ale35 commented 6 years ago

--output-format=json not giving output in proper json format when used with parameter --status-interval.

sitsofe commented 6 years ago

@jo-ale35 : which version of fio are you on and does your problem change if you use the git master version of fio?

jo-ale35 commented 6 years ago

am using "fio version" : "fio-3.8-5-g464b-dirty" and "fio version" : "fio-3.8"

sitsofe commented 6 years ago

@jo-ale35 are you able to deduce which part of the JSON is malformed?

jo-ale35 commented 6 years ago

The output we get is like the following:

JSON ``` { "fio version" : "fio-3.8-5-g464b-dirty", "timestamp" : 1535908946, "timestamp_ms" : 1535908946012, "time" : "Sun Sep 2 12:22:26 2018", "global options" : { "name" : "global", "runtime" : "3600", "rw" : "randwrite", "bs" : "64b", "direct" : "1", "ioengine" : "libpmem", "iodepth" : "1", "time_based" : "1", "gtod_reduce" : "0", "numjobs" : "8" }, "jobs" : [ { "jobname" : "drive0", "groupid" : 0, "error" : 0, "eta" : 3481, "elapsed" : 121, "job options" : { "filesize" : "434G", "cpus_allowed" : "24-31,56-63", "filename" : "/mnt/pmem7/data.dat" }, "read" : { "io_bytes" : 0, "io_kbytes" : 0, "bw_bytes" : 0, "bw" : 0, "iops" : 0.000000, "runtime" : 0, "total_ios" : 0, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "bw_min" : 0, "bw_max" : 0, "bw_agg" : 0.000000, "bw_mean" : 0.000000, "bw_dev" : 0.000000, "bw_samples" : 0, "iops_min" : 0, "iops_max" : 0, "iops_mean" : 0.000000, "iops_stddev" : 0.000000, "iops_samples" : 0 }, "write" : { "io_bytes" : 302157241728, "io_kbytes" : 295075431, "bw_bytes" : 2546862681, "bw" : 2487170, "iops" : 39794896.332572, "runtime" : 118639, "total_ios" : 4721226706, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 127, "max" : 24033733, "mean" : 1107.571169, "stddev" : 2461.596830, "percentile" : { "1.000000" : 580, "5.000000" : 636, "10.000000" : 660, "20.000000" : 700, "30.000000" : 748, "40.000000" : 812, "50.000000" : 900, "60.000000" : 1004, "70.000000" : 1144, "80.000000" : 1320, "90.000000" : 1576, "95.000000" : 1784, "99.000000" : 2224, "99.500000" : 2576, "99.900000" : 34048, "99.950000" : 35584, "99.990000" : 37632 } }, "lat_ns" : { "min" : 169, "max" : 24033791, "mean" : 1143.214753, "stddev" : 2475.840180 }, "bw_min" : 929, "bw_max" : 42156, "bw_agg" : 1.569530, "bw_mean" : 39036.883210, "bw_dev" : 9036.896600, "bw_samples" : 15104, "iops_min" : 14864, "iops_max" : 674498, "iops_mean" : 624597.112090, "iops_stddev" : 144590.408048, "iops_samples" : 15104 }, "trim" : { "io_bytes" : 0, "io_kbytes" : 0, "bw_bytes" : 0, "bw" : 0, "iops" : 0.000000, "runtime" : 0, "total_ios" : 0, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "bw_min" : 0, "bw_max" : 0, "bw_agg" : 0.000000, "bw_mean" : 0.000000, "bw_dev" : 0.000000, "bw_samples" : 0, "iops_min" : 0, "iops_max" : 0, "iops_mean" : 0.000000, "iops_stddev" : 0.000000, "iops_samples" : 0 }, "sync" : { "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "total_ios" : 0 }, "job_runtime" : 7589880, "usr_cpu" : 94.350345, "sys_cpu" : 5.613435, "ctx" : 57252, "majf" : 0, "minf" : 14236635, "iodepth_level" : { "1" : 99.999999, "2" : 0.000000, "4" : 0.000000, "8" : 0.000000, "16" : 0.000000, "32" : 0.000000, ">=64" : 0.000000 }, "latency_ns" : { "2" : 0.000000, "4" : 0.000000, "10" : 0.000000, "20" : 0.000000, "50" : 0.000000, "100" : 0.000000, "250" : 0.010000, "500" : 0.010000, "750" : 30.088449, "1000" : 29.335659 }, "latency_us" : { "2" : 38.456822, "4" : 1.790927, "10" : 0.040206, "20" : 0.010000, "50" : 0.277877, "100" : 0.010000, "250" : 0.010000, "500" : 0.010000, "750" : 0.010000, "1000" : 0.010000 }, "latency_ms" : { "2" : 0.010000, "4" : 0.010000, "10" : 0.010000, "20" : 0.010000, "50" : 0.010000, "100" : 0.000000, "250" : 0.000000, "500" : 0.000000, "750" : 0.000000, "1000" : 0.000000, "2000" : 0.000000, ">=2000" : 0.000000 }, "latency_depth" : 1, "latency_target" : 0, "latency_percentile" : 100.000000, "latency_window" : 0 } ], "disk_util" : [ { "name" : "pmem0", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem1", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem2", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem3", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem4", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem5", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem6", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem7", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 } ] } { "fio version" : "fio-3.8-5-g464b-dirty", "timestamp" : 1535909066, "timestamp_ms" : 1535909066035, "time" : "Sun Sep 2 12:24:26 2018", "global options" : { "name" : "global", "runtime" : "3600", "rw" : "randwrite", "bs" : "64b", "direct" : "1", "ioengine" : "libpmem", "iodepth" : "1", "time_based" : "1", "gtod_reduce" : "0", "numjobs" : "8" }, "jobs" : [ { "jobname" : "drive0", "groupid" : 0, "error" : 0, "eta" : 3361, "elapsed" : 241, "job options" : { "filesize" : "434G", "cpus_allowed" : "24-31,56-63", "filename" : "/mnt/pmem7/data.dat" }, "read" : { "io_bytes" : 0, "io_kbytes" : 0, "bw_bytes" : 0, "bw" : 0, "iops" : 0.000000, "runtime" : 0, "total_ios" : 0, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "bw_min" : 0, "bw_max" : 0, "bw_agg" : 0.000000, "bw_mean" : 0.000000, "bw_dev" : 0.000000, "bw_samples" : 0, "iops_min" : 0, "iops_max" : 0, "iops_mean" : 0.000000, "iops_stddev" : 0.000000, "iops_samples" : 0 }, "write" : { "io_bytes" : 627793988928, "io_kbytes" : 613080067, "bw_bytes" : 2630704652, "bw" : 2569047, "iops" : 41104846.023944, "runtime" : 238641, "total_ios" : 9809301560, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 127, "max" : 24033733, "mean" : 1061.394896, "stddev" : 2111.697041, "percentile" : { "1.000000" : 580, "5.000000" : 636, "10.000000" : 660, "20.000000" : 700, "30.000000" : 748, "40.000000" : 812, "50.000000" : 900, "60.000000" : 1004, "70.000000" : 1144, "80.000000" : 1320, "90.000000" : 1576, "95.000000" : 1768, "99.000000" : 2192, "99.500000" : 2416, "99.900000" : 31360, "99.950000" : 34048, "99.990000" : 36608 } }, "lat_ns" : { "min" : 168, "max" : 24033791, "mean" : 1096.985052, "stddev" : 2131.341586 }, "bw_min" : 929, "bw_max" : 42175, "bw_agg" : 1.565876, "bw_mean" : 40228.083180, "bw_dev" : 6477.611311, "bw_samples" : 30464, "iops_min" : 14864, "iops_max" : 674802, "iops_mean" : 643656.297466, "iops_stddev" : 103641.822437, "iops_samples" : 30464 }, "trim" : { "io_bytes" : 0, "io_kbytes" : 0, "bw_bytes" : 0, "bw" : 0, "iops" : 0.000000, "runtime" : 0, "total_ios" : 0, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "bw_min" : 0, "bw_max" : 0, "bw_agg" : 0.000000, "bw_mean" : 0.000000, "bw_dev" : 0.000000, "bw_samples" : 0, "iops_min" : 0, "iops_max" : 0, "iops_mean" : 0.000000, "iops_stddev" : 0.000000, "iops_samples" : 0 }, "sync" : { "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "total_ios" : 0 }, "job_runtime" : 15270003, "usr_cpu" : 97.177571, "sys_cpu" : 2.790504, "ctx" : 108896, "majf" : 0, "minf" : 14262626, "iodepth_level" : { "1" : 99.999999, "2" : 0.000000, "4" : 0.000000, "8" : 0.000000, "16" : 0.000000, "32" : 0.000000, ">=64" : 0.000000 }, "latency_ns" : { "2" : 0.000000, "4" : 0.000000, "10" : 0.000000, "20" : 0.000000, "50" : 0.000000, "100" : 0.000000, "250" : 0.010000, "500" : 0.010000, "750" : 30.068564, "1000" : 29.352280 }, "latency_us" : { "2" : 38.594394, "4" : 1.812583, "10" : 0.032625, "20" : 0.010000, "50" : 0.134193, "100" : 0.010000, "250" : 0.010000, "500" : 0.010000, "750" : 0.010000, "1000" : 0.010000 }, "latency_ms" : { "2" : 0.010000, "4" : 0.010000, "10" : 0.010000, "20" : 0.010000, "50" : 0.010000, "100" : 0.000000, "250" : 0.000000, "500" : 0.000000, "750" : 0.000000, "1000" : 0.000000, "2000" : 0.000000, ">=2000" : 0.000000 }, "latency_depth" : 1, "latency_target" : 0, "latency_percentile" : 100.000000, "latency_window" : 0 } ], "disk_util" : [ { "name" : "pmem0", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem1", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem2", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem3", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem4", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem5", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem6", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem7", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 } ] } But it is not in proper json fomat, It should be like the following: [{ "fio version" : "fio-3.8-5-g464b-dirty", "timestamp" : 1535908946, "timestamp_ms" : 1535908946012, "time" : "Sun Sep 2 12:22:26 2018", "global options" : { "name" : "global", "runtime" : "3600", "rw" : "randwrite", "bs" : "64b", "direct" : "1", "ioengine" : "libpmem", "iodepth" : "1", "time_based" : "1", "gtod_reduce" : "0", "numjobs" : "8" }, "jobs" : [ { "jobname" : "drive0", "groupid" : 0, "error" : 0, "eta" : 3481, "elapsed" : 121, "job options" : { "filesize" : "434G", "cpus_allowed" : "24-31,56-63", "filename" : "/mnt/pmem7/data.dat" }, "read" : { "io_bytes" : 0, "io_kbytes" : 0, "bw_bytes" : 0, "bw" : 0, "iops" : 0.000000, "runtime" : 0, "total_ios" : 0, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "bw_min" : 0, "bw_max" : 0, "bw_agg" : 0.000000, "bw_mean" : 0.000000, "bw_dev" : 0.000000, "bw_samples" : 0, "iops_min" : 0, "iops_max" : 0, "iops_mean" : 0.000000, "iops_stddev" : 0.000000, "iops_samples" : 0 }, "write" : { "io_bytes" : 302157241728, "io_kbytes" : 295075431, "bw_bytes" : 2546862681, "bw" : 2487170, "iops" : 39794896.332572, "runtime" : 118639, "total_ios" : 4721226706, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 127, "max" : 24033733, "mean" : 1107.571169, "stddev" : 2461.596830, "percentile" : { "1.000000" : 580, "5.000000" : 636, "10.000000" : 660, "20.000000" : 700, "30.000000" : 748, "40.000000" : 812, "50.000000" : 900, "60.000000" : 1004, "70.000000" : 1144, "80.000000" : 1320, "90.000000" : 1576, "95.000000" : 1784, "99.000000" : 2224, "99.500000" : 2576, "99.900000" : 34048, "99.950000" : 35584, "99.990000" : 37632 } }, "lat_ns" : { "min" : 169, "max" : 24033791, "mean" : 1143.214753, "stddev" : 2475.840180 }, "bw_min" : 929, "bw_max" : 42156, "bw_agg" : 1.569530, "bw_mean" : 39036.883210, "bw_dev" : 9036.896600, "bw_samples" : 15104, "iops_min" : 14864, "iops_max" : 674498, "iops_mean" : 624597.112090, "iops_stddev" : 144590.408048, "iops_samples" : 15104 }, "trim" : { "io_bytes" : 0, "io_kbytes" : 0, "bw_bytes" : 0, "bw" : 0, "iops" : 0.000000, "runtime" : 0, "total_ios" : 0, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "bw_min" : 0, "bw_max" : 0, "bw_agg" : 0.000000, "bw_mean" : 0.000000, "bw_dev" : 0.000000, "bw_samples" : 0, "iops_min" : 0, "iops_max" : 0, "iops_mean" : 0.000000, "iops_stddev" : 0.000000, "iops_samples" : 0 }, "sync" : { "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "total_ios" : 0 }, "job_runtime" : 7589880, "usr_cpu" : 94.350345, "sys_cpu" : 5.613435, "ctx" : 57252, "majf" : 0, "minf" : 14236635, "iodepth_level" : { "1" : 99.999999, "2" : 0.000000, "4" : 0.000000, "8" : 0.000000, "16" : 0.000000, "32" : 0.000000, ">=64" : 0.000000 }, "latency_ns" : { "2" : 0.000000, "4" : 0.000000, "10" : 0.000000, "20" : 0.000000, "50" : 0.000000, "100" : 0.000000, "250" : 0.010000, "500" : 0.010000, "750" : 30.088449, "1000" : 29.335659 }, "latency_us" : { "2" : 38.456822, "4" : 1.790927, "10" : 0.040206, "20" : 0.010000, "50" : 0.277877, "100" : 0.010000, "250" : 0.010000, "500" : 0.010000, "750" : 0.010000, "1000" : 0.010000 }, "latency_ms" : { "2" : 0.010000, "4" : 0.010000, "10" : 0.010000, "20" : 0.010000, "50" : 0.010000, "100" : 0.000000, "250" : 0.000000, "500" : 0.000000, "750" : 0.000000, "1000" : 0.000000, "2000" : 0.000000, ">=2000" : 0.000000 }, "latency_depth" : 1, "latency_target" : 0, "latency_percentile" : 100.000000, "latency_window" : 0 } ], "disk_util" : [ { "name" : "pmem0", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem1", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem2", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem3", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem4", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem5", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem6", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem7", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 } ] }, { "fio version" : "fio-3.8-5-g464b-dirty", "timestamp" : 1535909066, "timestamp_ms" : 1535909066035, "time" : "Sun Sep 2 12:24:26 2018", "global options" : { "name" : "global", "runtime" : "3600", "rw" : "randwrite", "bs" : "64b", "direct" : "1", "ioengine" : "libpmem", "iodepth" : "1", "time_based" : "1", "gtod_reduce" : "0", "numjobs" : "8" }, "jobs" : [ { "jobname" : "drive0", "groupid" : 0, "error" : 0, "eta" : 3361, "elapsed" : 241, "job options" : { "filesize" : "434G", "cpus_allowed" : "24-31,56-63", "filename" : "/mnt/pmem7/data.dat" }, "read" : { "io_bytes" : 0, "io_kbytes" : 0, "bw_bytes" : 0, "bw" : 0, "iops" : 0.000000, "runtime" : 0, "total_ios" : 0, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "bw_min" : 0, "bw_max" : 0, "bw_agg" : 0.000000, "bw_mean" : 0.000000, "bw_dev" : 0.000000, "bw_samples" : 0, "iops_min" : 0, "iops_max" : 0, "iops_mean" : 0.000000, "iops_stddev" : 0.000000, "iops_samples" : 0 }, "write" : { "io_bytes" : 627793988928, "io_kbytes" : 613080067, "bw_bytes" : 2630704652, "bw" : 2569047, "iops" : 41104846.023944, "runtime" : 238641, "total_ios" : 9809301560, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 127, "max" : 24033733, "mean" : 1061.394896, "stddev" : 2111.697041, "percentile" : { "1.000000" : 580, "5.000000" : 636, "10.000000" : 660, "20.000000" : 700, "30.000000" : 748, "40.000000" : 812, "50.000000" : 900, "60.000000" : 1004, "70.000000" : 1144, "80.000000" : 1320, "90.000000" : 1576, "95.000000" : 1768, "99.000000" : 2192, "99.500000" : 2416, "99.900000" : 31360, "99.950000" : 34048, "99.990000" : 36608 } }, "lat_ns" : { "min" : 168, "max" : 24033791, "mean" : 1096.985052, "stddev" : 2131.341586 }, "bw_min" : 929, "bw_max" : 42175, "bw_agg" : 1.565876, "bw_mean" : 40228.083180, "bw_dev" : 6477.611311, "bw_samples" : 30464, "iops_min" : 14864, "iops_max" : 674802, "iops_mean" : 643656.297466, "iops_stddev" : 103641.822437, "iops_samples" : 30464 }, "trim" : { "io_bytes" : 0, "io_kbytes" : 0, "bw_bytes" : 0, "bw" : 0, "iops" : 0.000000, "runtime" : 0, "total_ios" : 0, "short_ios" : 0, "drop_ios" : 0, "slat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "clat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000 }, "bw_min" : 0, "bw_max" : 0, "bw_agg" : 0.000000, "bw_mean" : 0.000000, "bw_dev" : 0.000000, "bw_samples" : 0, "iops_min" : 0, "iops_max" : 0, "iops_mean" : 0.000000, "iops_stddev" : 0.000000, "iops_samples" : 0 }, "sync" : { "lat_ns" : { "min" : 0, "max" : 0, "mean" : 0.000000, "stddev" : 0.000000, "percentile" : { "1.000000" : 0, "5.000000" : 0, "10.000000" : 0, "20.000000" : 0, "30.000000" : 0, "40.000000" : 0, "50.000000" : 0, "60.000000" : 0, "70.000000" : 0, "80.000000" : 0, "90.000000" : 0, "95.000000" : 0, "99.000000" : 0, "99.500000" : 0, "99.900000" : 0, "99.950000" : 0, "99.990000" : 0 } }, "total_ios" : 0 }, "job_runtime" : 15270003, "usr_cpu" : 97.177571, "sys_cpu" : 2.790504, "ctx" : 108896, "majf" : 0, "minf" : 14262626, "iodepth_level" : { "1" : 99.999999, "2" : 0.000000, "4" : 0.000000, "8" : 0.000000, "16" : 0.000000, "32" : 0.000000, ">=64" : 0.000000 }, "latency_ns" : { "2" : 0.000000, "4" : 0.000000, "10" : 0.000000, "20" : 0.000000, "50" : 0.000000, "100" : 0.000000, "250" : 0.010000, "500" : 0.010000, "750" : 30.068564, "1000" : 29.352280 }, "latency_us" : { "2" : 38.594394, "4" : 1.812583, "10" : 0.032625, "20" : 0.010000, "50" : 0.134193, "100" : 0.010000, "250" : 0.010000, "500" : 0.010000, "750" : 0.010000, "1000" : 0.010000 }, "latency_ms" : { "2" : 0.010000, "4" : 0.010000, "10" : 0.010000, "20" : 0.010000, "50" : 0.010000, "100" : 0.000000, "250" : 0.000000, "500" : 0.000000, "750" : 0.000000, "1000" : 0.000000, "2000" : 0.000000, ">=2000" : 0.000000 }, "latency_depth" : 1, "latency_target" : 0, "latency_percentile" : 100.000000, "latency_window" : 0 } ], "disk_util" : [ { "name" : "pmem0", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem1", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem2", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem3", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem4", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem5", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem6", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 }, { "name" : "pmem7", "read_ios" : 0, "write_ios" : 0, "read_merges" : 0, "write_merges" : 0, "read_ticks" : 0, "write_ticks" : 0, "in_queue" : 0, "util" : 0.000000 } ] } ] ```
axboe commented 6 years ago

The problem is that you get multiple sets of independently valid json, but smashed together it is not. You'd have to cut and paste each "section" (the one that starts with "fio version" etc) into separate files, then it would validate fine.

Not sure how we can improve that, to be honest. Status interval dumps valid json output for each time period specified.

axboe commented 6 years ago

I don't know json well enough to guess if there's some way we can separate streams nicely in the file. If that was possible, then we could just do that before dumping output. For instance, have a comma separator between them. I'll try and google a bit, but in lieu of that being possible, then I don't see how we can feasibly fix this. You'd simply need to manually separate the streams after the run is over - which kind of sucks, but isn't the end of the world.

jo-ale35 commented 6 years ago

we are creating an array and putting the different outputs inside it with each one seperated by a comma.

axboe commented 6 years ago

I'd be fine with something like that. Do you have a patch?

jo-ale35 commented 6 years ago

As of now am parsing the json generated by fio and making it to valid json.

suprajamayya commented 6 years ago

@axboe I do not have a patch for the code , but I had written a workaround in python snippet to achieve the same to make it a valid JSON . It makes the content as an array of lists , which is a valid JSON

from pathlib import Path
import sys

p=Path('.')
#fetching the .json files using regular expression for custom loading
s=list(p.glob('[a-zA-Z0-9]*_DCPMEM_FIO_PMEM[a-zA-Z0-9]*.json'))

filedata = None
#assigning the run time arguments. arguments will be the file name
a=sys.argv[1]

#opening the file in read mode
with open(a, 'r') as file :
    filedata = file.read()

#replacing the pattern }\n{ of the file with the below to make it a valid json
filedata = filedata.replace('}\n{', '},\n{')
#inserting this in the beginning and the end of the file to make it a array of lists
filedata = "[" + filedata + "]"

#writing the data into the same file
with open(a, 'w') as file:
    file.write(filedata)
joshginter commented 4 years ago

I'd like to look into tackling this patch.

The "problem" is that when FIO prints multiple status (through use of "--status-interval" option) the resulting output is multiple top level json "objects" in one file. The proposed solution is to make this a top level array of json objects. Is this a fair restatement of the situation?

There are some nuances to cover though.

  1. Should FIO only print this "array format" when --status-interval is used?
  2. Or should it always use the array format so that a single json output becomes an array of one status?

In option 1 above the json output is consistent, it's always an array at the top-level this is a positive because an application can use the same parsing logic whether it is a single status or multiple statuses. Option 2 has the downside of any existing applications that parse the json output today will break. (Option 1 has really has a lesser version of the same problem, as any application that has a built-in work-around like what @suprajamayya posted above would break.

Does it make sense to have a new option in --output-format for "json_array" and "json+_array" that will act as a switch for this new code rather than changing the existing behavior?

sitsofe commented 4 years ago

Is this a fair restatement of the situation?

Sounds like it. It's a bit tough on people who are wrapping the existing format but I would think they would quickly spot the change but I see you've already thought of that...

Does it make sense to have a new option in --output-format for "json_array" and "json+_array" that will act as a switch for this new code rather than changing the existing behavior?

That sounds like a very sensible way to solve this. Half of me would want it to be called "json++" but maybe that's a step to far and will give people the wrong idea... I'm already in agreement with the main idea and me bikeshedding the name doesn't further your work :-).

sitsofe commented 4 years ago

FWIW looking at https://en.wikipedia.org/wiki/JSON_streaming the solutions there don't really solve the original problem which seems to be a desire to have strictly well formed json that can be read with "any" JSON tool (which is what the JSON array proposal does). To me the only issue with the JSON array solution will be processing the output "online". I'd argue if you're processing online you can write a custom tool to cope with the current json/json+ modes (which basically offer "Concatenated JSON") and the JSON array option will be useful to those processing offline (so people can pick).