[rrd-users] Simple questions about RRD

Jean-Yves Avenard jyavenard at gmail.com
Sat Dec 5 14:19:36 CET 2009


2009/12/5 A Darren Dunham <ddunham at taos.com>:
>
> Hopefully that demonstrates the differences pretty well.
>

Actually ; looking at the graph ; I can't understand how the MAX is
actually calculated.

Looking at:
http://htpc.avenard.org/power/screen.png

It shows the maximum as being 2972W ; which is indeed the maximum with
the actual data at the highest resolution.
But it's definitely not the maximum of 5 minutes average as the graph
shows: nothing is over 2200W

That graph is created with :

$ret = exec("$RRDTOOL graph $name -l 0 \
-t '$title' \
-x $legend \
--step $res --start e-$start --end $timestamp \
-w $width -h $height \
DEF:total=currentcost.rrd:total:AVERAGE DEF:ch2=currentcost.rrd:ch2:AVERAGE \
DEF:solar=solarprod.rrd:total:AVERAGE DEF:ch1=currentcost.rrd:ch1:AVERAGE \
DEF:totalmin=currentcost.rrd:total:MIN:reduce=AVERAGE
DEF:ch2min=currentcost.rrd:ch2:MIN:reduce=AVERAGE \
DEF:solarmin=solarprod.rrd:total:MIN:reduce=AVERAGE
DEF:ch1min=currentcost.rrd:ch1:MIN:reduce=AVERAGE \
DEF:totalmax=currentcost.rrd:total:MAX:reduce=AVERAGE
DEF:ch2max=currentcost.rrd:ch2:MAX:reduce=AVERAGE \
DEF:solarmax=solarprod.rrd:total:MAX:reduce=AVERAGE
DEF:ch1max=currentcost.rrd:ch1:MAX:reduce=AVERAGE \
    VDEF:ds0max=ch2max,MAXIMUM \
    VDEF:ds0avg=ch2,AVERAGE \
    VDEF:ds0min=ch2min,MINIMUM \
    VDEF:ds0pct=ch2,95,PERCENT \
    VDEF:ds1max=totalmax,MAXIMUM \
    VDEF:ds1avg=total,AVERAGE \
    VDEF:ds1min=totalmin,MINIMUM \
    VDEF:ds1pct=total,95,PERCENT \
    VDEF:ds2max=ch1max,MAXIMUM \
    VDEF:ds2avg=ch1,AVERAGE \
    VDEF:ds2min=ch1min,MINIMUM \
    VDEF:ds2pct=ch1,95,PERCENT \
    VDEF:ds3max=solarmax,MAXIMUM \
    VDEF:ds3avg=solar,AVERAGE \
    VDEF:ds3min=solarmin,MINIMUM \
    VDEF:ds3pct=solar,95,PERCENT \
 COMMENT:'           ' \
 COMMENT:'Maximum ' \
    COMMENT:'Average ' \
    COMMENT:'Minimum '  \
    COMMENT:'95th percentile\l' \
    LINE1:total#000090:'Total   ' \
    GPRINT:ds1max:'%5.0lf W ' \
    GPRINT:ds1avg:'%5.0lf W ' \
    GPRINT:ds1min:'%5.0lf W ' \
    GPRINT:ds1pct:' %5.0lf W\l' \
    LINE1:ch1#00FF00:'Pool    ' \
    GPRINT:ds2max:'%5.0lf W ' \
    GPRINT:ds2avg:'%5.0lf W ' \
    GPRINT:ds2min:'%5.0lf W ' \
    GPRINT:ds2pct:' %5.0lf W\l' \
    LINE1:solar#FF0000:'Solar   ' \
    GPRINT:ds3max:'%5.0lf W ' \
    GPRINT:ds3avg:'%5.0lf W ' \
    GPRINT:ds3min:'%5.0lf W ' \
    GPRINT:ds3pct:' %5.0lf W\l'

where $res , the argument for --step is 300 (5 minutes) and I do use
the reduce=AVERAGE option.

Thanks for your help once again.
Jean-Yves



More information about the rrd-users mailing list