[rrd-users] Newbie Question Storing Absolute Values versus Average

guy Fleegman network.monger at gmail.com
Tue Jun 17 16:11:33 CEST 2008

I am still struggling with the idea of why i dont always get whole numbers for
my data points.
Let me explain...
I tool the example you gave me and modified it...

As I understand it... I have 30 second buckets... and every 60 seconds...
I will update the RRA. This should cause to entries to be updated

The first one creates the RRA, after that the next 2 get updated with a value\
of 0
The following 2 entries with a value of 1
The following 2 entries with a value of 2

However.. what happens looks quite different.. here is the output... and the
program used below

root at nagios:~/Desktop/testrrd# ./script4.sh 
2008-06-17 09:55:20 1213710920 0
return_value = 0
[1213710870]RRA[MAX][1]DS[in] = 0.0000000000e+00
[1213710900]RRA[MAX][1]DS[in] = 0.0000000000e+00
2008-06-17 09:56:20 1213710980 1
return_value = 0
[1213710930]RRA[MAX][1]DS[in] = 6.6666666667e-01
[1213710960]RRA[MAX][1]DS[in] = 6.6666666667e-01
2008-06-17 09:57:20 1213711040 2
return_value = 0
[1213710990]RRA[MAX][1]DS[in] = 1.6666666667e+00
[1213711020]RRA[MAX][1]DS[in] = 1.6666666667e+00
2008-06-17 09:58:20 1213711100 3
return_value = 0
[1213711050]RRA[MAX][1]DS[in] = 2.6666666667e+00
[1213711080]RRA[MAX][1]DS[in] = 2.6666666667e+00
2008-06-17 09:59:20 1213711160 4
return_value = 0
[1213711110]RRA[MAX][1]DS[in] = 3.6666666667e+00
[1213711140]RRA[MAX][1]DS[in] = 3.6666666667e+00

rrdtool create test4.rrd --start now --step 30 \
               DS:in:GAUGE:120:U:U \

echo created.

while true; do
  sleep 60
  DATE=( $(date "+%Y-%m-%d %T %s") )
  echo ${DATE[*]} $a
  rrdtool updatev test4.rrd ${DATE[2]}:$a


What baffles me... is that if I set the bucket size to 5 seconds.. and then a
sleep time of 10... it works without the rounding factor.....

what is going on and what is missing in my understanding?

Thanks... I am really trying to grasp this

More information about the rrd-users mailing list