From: vincentfu@gmail.com
To: axboe@kernel.dk, fio@vger.kernel.org
Cc: Vincent Fu <vincent.fu@wdc.com>
Subject: [PATCH 2/2] stat: put 'percentiles' object in appropriate 'clat_ns' or 'lat_ns' parent
Date: Thu, 7 Feb 2019 10:51:07 -0500 [thread overview]
Message-ID: <20190207155107.7148-3-vincentfu@gmail.com> (raw)
In-Reply-To: <20190207155107.7148-1-vincentfu@gmail.com>
From: Vincent Fu <vincent.fu@wdc.com>
In the JSON output, the 'percentiles' object currently always appears within the
'clat_ns' object. Put it inside the 'lat_ns' object when --lat_percentiles=1 is set.
---
stat.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/stat.c b/stat.c
index 7c843e6b..c1f46e1d 100644
--- a/stat.c
+++ b/stat.c
@@ -1088,7 +1088,8 @@ static void add_ddir_status_json(struct thread_stat *ts,
len = 0;
percentile_object = json_create_object();
- json_object_add_value_object(tmp_object, "percentile", percentile_object);
+ if (ts->clat_percentiles)
+ json_object_add_value_object(tmp_object, "percentile", percentile_object);
for (i = 0; i < len; i++) {
snprintf(buf, sizeof(buf), "%f", ts->percentile_list[i].u.f);
json_object_add_value_int(percentile_object, (const char *)buf, ovals[i]);
@@ -1127,6 +1128,8 @@ static void add_ddir_status_json(struct thread_stat *ts,
json_object_add_value_int(tmp_object, "max", max);
json_object_add_value_float(tmp_object, "mean", mean);
json_object_add_value_float(tmp_object, "stddev", dev);
+ if (ts->lat_percentiles)
+ json_object_add_value_object(tmp_object, "percentile", percentile_object);
if (output_format & FIO_OUTPUT_JSON_PLUS && ts->lat_percentiles)
json_object_add_value_object(tmp_object, "bins", clat_bins_object);
--
2.17.1
next prev parent reply other threads:[~2019-02-07 15:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 15:51 [PATCH 0/2] stat cleanup/bugfix patches vincentfu
2019-02-07 15:51 ` [PATCH 1/2] stat: clean up calc_clat_percentiles vincentfu
2019-02-07 15:51 ` vincentfu [this message]
2019-02-07 16:49 ` [PATCH 0/2] stat cleanup/bugfix patches Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190207155107.7148-3-vincentfu@gmail.com \
--to=vincentfu@gmail.com \
--cc=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=vincent.fu@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox