Mike Slifcak <slif with bellsouth.net> many rrdtool-1.1.x fixes
Oleg Cherevko <olwi with icyb.kiev.ua>
Otmar Lendl <O.Lendl with Austria.EU.net> (lots of bugfixes)
+Patrick Cherry <patrick with bytemark.co.uk>
Paul Joslin <Paul.Joslin with sdrc.com>
Peter Speck <speck with vitality.dk> eps/svg/pdf file format code in rrdtool-1.x
Peter Stamfest <peter with stamfest.at> initial multi-thread support
Example: C<VDEF:avg=mydata,AVERAGE>
+=item STDEV
+
+Returns the standard deviation of the values.
+
+Example: C<VDEF:stdev=mydata,STDEV>
+
=item LAST, FIRST
Return the last/first value including its time. The time for
gdes->vf.op = VDEF_MAXIMUM;
else if (!strcmp("AVERAGE", func))
gdes->vf.op = VDEF_AVERAGE;
+ else if (!strcmp("STDEV", func))
+ gdes->vf.op = VDEF_STDEV;
else if (!strcmp("MINIMUM", func))
gdes->vf.op = VDEF_MINIMUM;
else if (!strcmp("TOTAL", func))
break;
case VDEF_MAXIMUM:
case VDEF_AVERAGE:
+ case VDEF_STDEV:
case VDEF_MINIMUM:
case VDEF_TOTAL:
case VDEF_FIRST:
}
break;
case VDEF_TOTAL:
+ case VDEF_STDEV:
case VDEF_AVERAGE:{
int cnt = 0;
double sum = 0.0;
+ double average = 0.0;
for (step = 0; step < steps; step++) {
if (finite(data[step * src->ds_cnt])) {
if (dst->vf.op == VDEF_TOTAL) {
dst->vf.val = sum * src->step;
dst->vf.when = 0; /* no time component */
- } else {
+ } else if (dst->vf.op == VDEF_AVERAGE){
dst->vf.val = sum / cnt;
dst->vf.when = 0; /* no time component */
+ } else {
+ average = sum / cnt;
+ sum = 0.0;
+ for (step=0;step<steps;step++) {
+ if (finite(data[step*src->ds_cnt])) {
+ sum += pow((data[step*src->ds_cnt] - average),2.0);
+ };
+ }
+ dst->vf.val = pow(sum / cnt,0.5);
+ dst->vf.when = 0; /* no time component */
};
} else {
dst->vf.val = DNAN;
VDEF_MAXIMUM = 0 /* like the MAX in (G)PRINT */
, VDEF_MINIMUM /* like the MIN in (G)PRINT */
, VDEF_AVERAGE /* like the AVERAGE in (G)PRINT */
+ , VDEF_STDEV /* the standard deviation */
, VDEF_PERCENT /* Nth percentile */
, VDEF_TOTAL /* average multiplied by time */
, VDEF_FIRST /* first non-unknown value and time */