stat: fix group percentage
authorSitsofe Wheeler <sitsofe@yahoo.com>
Mon, 26 Jun 2017 23:04:40 +0000 (00:04 +0100)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Mon, 26 Jun 2017 23:47:27 +0000 (00:47 +0100)
When af7f87cb59fb3fc29a7d9f56f03f7b42680a45f2 converted group stats to
bytes it broke the group percentage calculation because the mean is in
kilobytes but the aggregate bandwidth is in kilobytes. Fix this by
converting aggregate bandwidth to kilobytes when calculating the
thread's group percentage.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
stat.c

diff --git a/stat.c b/stat.c
index d496e8f968fee2f47d761f4c9e244e6c6ad08744..beec574d8bd4e80767e683f5631e838d6df853d1 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -483,7 +483,7 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts,
                }
 
                if (rs->agg[ddir]) {
-                       p_of_agg = mean * 100 / (double) rs->agg[ddir];
+                       p_of_agg = mean * 100 / (double) (rs->agg[ddir] / 1024);
                        if (p_of_agg > 100.0)
                                p_of_agg = 100.0;
                }