From: Andreas Herrmann <aherrmann@suse.com>
To: Jens Axboe <axboe@fb.com>
Cc: fio@vger.kernel.org
Subject: [PATCH 2/4] stat: Print number of samples in bw and iops stats
Date: Fri, 23 Jun 2017 19:42:58 +0200 [thread overview]
Message-ID: <20170623174300.7937-3-aherrmann@suse.com> (raw)
In-Reply-To: <20170623174300.7937-1-aherrmann@suse.com>
This adds the actual number of samples for bw and iops stats printed
in normal and json fio output. Example for normal output:
bw ( MiB/s): min= 120, max= 3304, per=0.10%, avg=2659.34, stdev=1085.25, samples= 109
iops : min=102776, max=830416, avg=675639.05, stdev=280619.99, samples= 21
Note: This example was created using options
"--write_bw_log=... --log_avg_msec=100 --runtime=11s" (ie. no iops log
written). That is why number of samples differs for IOPs and BW.
Signed-off-by: Andreas Herrmann <aherrmann@suse.com>
---
stat.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/stat.c b/stat.c
index d519ee9e..369f9696 100644
--- a/stat.c
+++ b/stat.c
@@ -496,12 +496,15 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts,
bw_str = (rs->unit_base == 1 ? "Mibit" : "MiB");
}
- log_buf(out, " bw (%5s/s): min=%5llu, max=%5llu, per=%3.2f%%, avg=%5.02f, stdev=%5.02f\n",
- bw_str, min, max, p_of_agg, mean, dev);
+ log_buf(out, " bw (%5s/s): min=%5llu, max=%5llu, per=%3.2f%%, "
+ "avg=%5.02f, stdev=%5.02f, samples=%5lu\n",
+ bw_str, min, max, p_of_agg, mean, dev,
+ (&ts->bw_stat[ddir])->samples);
}
if (calc_lat(&ts->iops_stat[ddir], &min, &max, &mean, &dev)) {
log_buf(out, " iops : min=%5llu, max=%5llu, avg=%5.02f, "
- "stdev=%5.02f\n", min, max, mean, dev);
+ "stdev=%5.02f, samples=%5lu\n",
+ min, max, mean, dev, (&ts->iops_stat[ddir])->samples);
}
}
@@ -1051,6 +1054,8 @@ static void add_ddir_status_json(struct thread_stat *ts,
json_object_add_value_float(dir_object, "bw_agg", p_of_agg);
json_object_add_value_float(dir_object, "bw_mean", mean);
json_object_add_value_float(dir_object, "bw_dev", dev);
+ json_object_add_value_int(dir_object, "bw_samples",
+ (&ts->bw_stat[ddir])->samples);
if (!calc_lat(&ts->iops_stat[ddir], &min, &max, &mean, &dev)) {
min = max = 0;
@@ -1060,6 +1065,8 @@ static void add_ddir_status_json(struct thread_stat *ts,
json_object_add_value_int(dir_object, "iops_max", max);
json_object_add_value_float(dir_object, "iops_mean", mean);
json_object_add_value_float(dir_object, "iops_stddev", dev);
+ json_object_add_value_int(dir_object, "iops_samples",
+ (&ts->iops_stat[ddir])->samples);
}
static void show_thread_status_terse_v2(struct thread_stat *ts,
--
2.12.0
next prev parent reply other threads:[~2017-06-23 17:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-23 17:42 [PATCH v3 0/4] stat: Modify info for bw and add iops stats Andreas Herrmann
2017-06-23 17:42 ` [PATCH 1/4] stat: Print one-line iops stat Andreas Herrmann
2017-06-23 18:26 ` Jens Axboe
2017-06-23 19:47 ` Andreas Herrmann
2017-06-23 17:42 ` Andreas Herrmann [this message]
2017-06-23 17:42 ` [PATCH 3/4] stat: Merge show_thread_status_terse_* functions Andreas Herrmann
2017-06-23 17:43 ` [PATCH 4/4] stat: Add iops stat and sample number information to terse format Andreas Herrmann
2017-06-23 18:15 ` [PATCH v3 0/4] stat: Modify info for bw and add iops stats Jens Axboe
2017-06-23 19:45 ` Andreas Herrmann
2017-06-23 19:56 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2017-06-23 22:27 [PATCH v4 " Andreas Herrmann
2017-06-23 22:27 ` [PATCH 2/4] stat: Print number of samples in bw and " Andreas Herrmann
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=20170623174300.7937-3-aherrmann@suse.com \
--to=aherrmann@suse.com \
--cc=axboe@fb.com \
--cc=fio@vger.kernel.org \
/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