From db84b73bd7b0c3b718596fbeb6a5f940b05a6735 Mon Sep 17 00:00:00 2001 From: Sitsofe Wheeler Date: Tue, 27 Jun 2017 00:04:40 +0100 Subject: [PATCH 1/1] stat: fix group percentage 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 --- stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stat.c b/stat.c index d496e8f9..beec574d 100644 --- 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; } -- 2.25.1