Default stdev to 0.0, not -1.0
authorJens Axboe <jens.axboe@oracle.com>
Thu, 19 Jul 2007 19:38:35 +0000 (21:38 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 19 Jul 2007 19:38:35 +0000 (21:38 +0200)
If we only have a single sample, then the deviation is by definition 0.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
stat.c

diff --git a/stat.c b/stat.c
index 28d85c189f3fc0cf20ceb7dc7b40b4bd5c402cce..38f94be0138e7a063bb9e31155bc8e78e8f83d28 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -82,7 +82,7 @@ static int calc_lat(struct io_stat *is, unsigned long *min, unsigned long *max,
        if (n > 1.0)
                *dev = sqrt(is->S / (n - 1.0));
        else
-               *dev = -1.0;
+               *dev = 0;
 
        return 1;
 }