From: Jens Axboe Date: Tue, 6 Mar 2007 14:37:00 +0000 (+0100) Subject: Stat summation fixup X-Git-Tag: fio-1.14~79 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c39cced652676a2b1dd76a98ca54f23b1f844cc5 Stat summation fixup Signed-off-by: Jens Axboe --- diff --git a/stat.c b/stat.c index 5470c87f..07c9b62e 100644 --- a/stat.c +++ b/stat.c @@ -579,8 +579,8 @@ static void __sum_stat(struct io_stat *dst, struct io_stat *src, int nr) mean = src->mean; S = src->S; } else { - mean = ((src->mean * (double) nr) + dst->mean) / ((double) nr + 1.0); - S = ((src->S * (double) nr) + dst->S) / ((double) nr + 1.0); + mean = ((src->mean * (double) (nr - 1)) + dst->mean) / ((double) nr); + S = ((src->S * (double) (nr - 1)) + dst->S) / ((double) nr); } dst->mean = mean;