[rrd-users] problem calculating the difference between MAX and MIN

Steve Shipway s.shipway at auckland.ac.nz
Thu Jun 27 23:49:42 CEST 2013

> this is my create command:
> rrdtool create c:/rrdtool/VSM.rrd --start $epoch_start --step 10
> DS:Watt_cur:GAUGE:60:U:U RRA:MAX:0.5:1:60480 DS:Watt_tot:GAUGE:60:U:U
> RRA:MAX:0.5:1:60480
> you are right, I have no RRA:MIN

Also, you have the same MAX RRA specified twice.  The RRAs apply to ALL defined DSs, no matter what order you specify them.

This is what you used (reorganised for clarity)

rrdtool create c:/rrdtool/VSM.rrd --start $epoch_start --step 10
 DS:Watt_cur:GAUGE:60:U:U DS:Watt_tot:GAUGE:60:U:U
 RRA:MAX:0.5:1:60480 RRA:MAX:0.5:1:60480

This is likely what you SHOULD use:

rrdtool create c:/rrdtool/VSM.rrd --start $epoch_start --step 10
 DS:Watt_cur:GAUGE:60:U:U DS:Watt_tot:GAUGE:60:U:U
 RRA:MAX:0.5:1:60480 RRA:MIN:0.5:1:60480

Having MAX and MIN on a 1cdp=1pdp RRA is the same as AVERAGE and a bit redundant, but it's required for your graph command.  It is pointless, though, as the MAX, MIN and AVG for a single data point will be the datapoint itself!  

Note that you do not have any summary RRAs (IE, where 1cdp is more than 1pdp).  This might be intentional; however, if you want to efficiently create monthly or yearly graphs, you should probably add them (and then MAX or MIN would make more sense).  You may also want to add an AVG RRA.

The step is only 10 sec, so maybe you'd want a 5min summary RRA set to make a daily graph work faster.  So, add:

  RRA:AVG:0.5:30:2016 RRA:MIN:0.5:30:2016 RRA:MAX:0.5:30:2016

Finally - why do you have a 'watt_total' DS if you have a 'Watt current'?  I'm assuming the current holds the current rate (RRD loves rates) and the total is more the total Joules, IE sum(watt_current) over time.  In that case, you could calculate the total value in RRD as a VDEF of sum(current_average)*interval_length perhaps?



Steve Shipway
ITS Unix Services Design Lead
University of Auckland, New Zealand
Floor 1, 58 Symonds Street, Auckland
Phone: +64 (0)9 3737599 ext 86487
DDI: +64 (0)9 923 6487
Mobile: +64 (0)21 753 189
Email: s.shipway at auckland.ac.nz
 Please consider the environment before printing this e-mail : 打印本邮件,将减少一棵树存活的机会

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5900 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20130627/99cfffed/attachment.bin 

More information about the rrd-users mailing list