From b01af66b13f0594617602b61d31b1495292e5fd2 Mon Sep 17 00:00:00 2001 From: Christopher Jacobs Date: Mon, 22 Jun 2015 14:14:50 -0700 Subject: [PATCH] add eta and elapsed to root of json output --- stat.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stat.c b/stat.c index 30a2c1e7..00eb75d7 100644 --- a/stat.c +++ b/stat.c @@ -1062,17 +1062,26 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts, struct group_run_stats *rs) { struct json_object *root, *tmp; + struct jobs_eta *je; double io_u_dist[FIO_IO_U_MAP_NR]; double io_u_lat_u[FIO_IO_U_LAT_U_NR]; double io_u_lat_m[FIO_IO_U_LAT_M_NR]; double usr_cpu, sys_cpu; int i; + size_t size; + root = json_create_object(); json_object_add_value_string(root, "jobname", ts->name); json_object_add_value_int(root, "groupid", ts->groupid); json_object_add_value_int(root, "error", ts->error); + /* ETA Info */ + je = get_jobs_eta(1, &size); + json_object_add_value_int(root, "eta", je->eta_sec); + json_object_add_value_int(root, "elapsed", je->elapsed_sec); + + add_ddir_status_json(ts, rs, DDIR_READ, root); add_ddir_status_json(ts, rs, DDIR_WRITE, root); add_ddir_status_json(ts, rs, DDIR_TRIM, root); -- 2.25.1