[rrd-users] Average value over last ten minutes?

Steve Shipway s.shipway at auckland.ac.nz
Sun Jul 8 23:37:03 CEST 2012


> I created an RRD with "-s 60", so I think it should record a data point every
> minute? I then try to get the average value over the last ten minutes with
> "rrdtool fetch example.rrd AVERAGE -r 600 -s -600", but instead of one average
> value, it returns eleven values, each one minute apart

You don't say what RRAs you have defined in your RRD.  Although -s60 means a step size of 60 and therefore sample (pdp) at interval 60s, what is actually stored depends on your RRAs.

Assuming you have defined an RRA with 1cdp=1pdp, then you will be storing data at 60s intervals, too.  You COULD create an RRA with 1cdp=10pdp, which will store data at 10min averages (which is apparently what you want).

Using FETCH will retrieve the data as stored in the RRA.  If you do not have a 10min RRA, or if your requested time period does not exactly match the 10min RRA periods, then you will use the 1min RRA (and get 11 samples).

This second case is important.  If you ask for a start of 12:00 and an end of 12:10, this actually covers 11 1-minute periods.  A 1min RRA would cover 12:00:00 - 12:09:59, so asking for and end of 12:10:00 means you've gone into the next 'bucket'.  The closest match would be 11 samples from the 1min RRA rather than 2 samples from the 10min RRA so that's what you get. RRDtool will use the closest match from the available RRAs that gives as much or more than you ask for.

Of course, if you've not created a 10min RRA then you're bound to get 1min samples.

If you instead use rrdtool XPORT then calculations can be performed, and you can obtain 10min intervals even if you do not have a 10min RRA available.

Hope this helps!

Steve

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 924 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: 6080 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20120708/e9120a9b/attachment-0001.bin 


More information about the rrd-users mailing list