From: oetiker Date: Tue, 21 Dec 2010 16:38:22 +0000 (+0000) Subject: Sigma calculation had an error. The first data value in each bin didn't get squared... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=04aa3f00cc814fdb85fa14469dba99923dfd182d;p=rrdtool.git Sigma calculation had an error. The first data value in each bin didn't get squared. -- Hans Jørgen Jakobsen git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2154 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_fetch_libdbi.c b/src/rrd_fetch_libdbi.c index 2c4c722..6a22026 100644 --- a/src/rrd_fetch_libdbi.c +++ b/src/rrd_fetch_libdbi.c @@ -615,7 +615,7 @@ rrd_fetch_fn_libdbi( (*data)[idx*(*ds_cnt)+1]=r_value; /* AVG */ (*data)[idx*(*ds_cnt)+2]=r_value; /* MAX */ (*data)[idx*(*ds_cnt)+3]=1; /* COUNT */ - (*data)[idx*(*ds_cnt)+4]=r_value; /* SIGMA */ + (*data)[idx*(*ds_cnt)+4]=r_value*r_value; /* SIGMA */ } else { /* MIN */ if ((*data)[idx*(*ds_cnt)+0]>r_value) { (*data)[idx*(*ds_cnt)+0]=r_value; }