stat: correct json 'io_bytes' output
authorJens Axboe <axboe@kernel.dk>
Mon, 5 Jun 2017 20:05:43 +0000 (14:05 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 5 Jun 2017 20:05:43 +0000 (14:05 -0600)
Since the dawn of time, this has outputted kilobytes, not bytes.
Correct this oversight, and also add a 'io_kbytes' key that shows
the old output.

Fixes: 378
Signed-off-by: Jens Axboe <axboe@kernel.dk>
stat.c

diff --git a/stat.c b/stat.c
index e433c6d3858fb454c336df58966a48d68b089cfb..fd3ad5aa248b2caf6e78c08e8ed330ac2cdf0eb3 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -919,7 +919,8 @@ static void add_ddir_status_json(struct thread_stat *ts,
                iops = (1000.0 * (uint64_t) ts->total_io_u[ddir]) / runt;
        }
 
                iops = (1000.0 * (uint64_t) ts->total_io_u[ddir]) / runt;
        }
 
-       json_object_add_value_int(dir_object, "io_bytes", ts->io_bytes[ddir] >> 10);
+       json_object_add_value_int(dir_object, "io_bytes", ts->io_bytes[ddir]);
+       json_object_add_value_int(dir_object, "io_kbytes", ts->io_bytes[ddir] >> 10);
        json_object_add_value_int(dir_object, "bw", bw);
        json_object_add_value_float(dir_object, "iops", iops);
        json_object_add_value_int(dir_object, "runtime", ts->runtime[ddir]);
        json_object_add_value_int(dir_object, "bw", bw);
        json_object_add_value_float(dir_object, "iops", iops);
        json_object_add_value_int(dir_object, "runtime", ts->runtime[ddir]);