From 84f1f8658b728955b9853712186b1851d5fe303c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 15 Dec 2015 13:48:32 -0700 Subject: [PATCH] client: cleanup json output Signed-off-by: Jens Axboe --- client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 35cbf68c..c24f89b4 100644 --- a/client.c +++ b/client.c @@ -119,6 +119,7 @@ static void fio_client_json_init(void) { if (!(output_format & FIO_OUTPUT_JSON)) return; + root = json_create_object(); json_object_add_value_string(root, "fio version", fio_version_string); clients_array = json_create_array(); @@ -131,6 +132,7 @@ static void fio_client_json_fini(void) { if (!(output_format & FIO_OUTPUT_JSON)) return; + log_info("\n"); json_print_object(root, NULL); log_info("\n"); json_free_object(root); @@ -968,7 +970,8 @@ static void handle_gs(struct fio_client *client, struct fio_net_cmd *cmd) { struct group_run_stats *gs = (struct group_run_stats *) cmd->payload; - show_group_stats(gs, NULL); + if (output_format & FIO_OUTPUT_NORMAL) + show_group_stats(gs, NULL); } static void handle_text(struct fio_client *client, struct fio_net_cmd *cmd) -- 2.25.1