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

Karl Fischer rrd-users at ficos.de
Wed Jun 4 23:16:27 CEST 2008


> Ok I see what you are saying.. I now understnad the difference between
> the "heartbeat" and the step.... but it makes me pause to wonder...
> Why are the values that i am telling it to be updated with not the
> actual values showing up for that entry? (The appear to be less)
> If I am sending an update of N:1:1:1  I would think that line would
> show 1:1:1 in the dump... likewise.. .if I send in the next period
> N:2:2:2
> That I would have 2's appear.
>
> Let's take your script as an example..... I changed it to increment
> the a value each time...
>
> #!/bin/bash
>
> date "+%Y-%m-%d %T (%s)"
>
> rrdtool create test3.rrd --start now --step 5 DS:in:GAUGE:120:U:U \
>   DS:out:GAUGE:120:U:U DS:busyper:GAUGE:120:U:U RRA:LAST:0.5:1:60
>
> echo created.
> a=1
> while true; do
>   date "+%Y-%m-%d %T (%s)"
>   rrdtool updatev test3.rrd N:$a:$a:$a
>   echo $a
>   sleep 1
>   a=$((a+1))
> done

this little script was only meant to show you that the rrd doesn't
accept the multiple updates within the step-value.
As Alex mentioned already,  the multiple updates withing one step
are averaged. Try updating *at* the step value vs *in between* :


#!/bin/bash
while [ $(( $(date +%S) % 5 )) -gt 0 ]; do
  sleep 1
  date "+%Y-%m-%d %T (%s)"
done

rrdtool create test3.rrd --start now --step 5 \
               DS:in:GAUGE:120:U:U \
               RRA:LAST:0.5:1:60

echo created.

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


result:




./test4.sh
2008-06-04 23:08:27 (1212613707)
2008-06-04 23:08:28 (1212613708)
2008-06-04 23:08:29 (1212613709)
2008-06-04 23:08:30 (1212613710)
created.
2008-06-04 23:08:35 1212613715 0
return_value = 0
[1212613715]RRA[LAST][1]DS[in] = 0.0000000000e+00
2008-06-04 23:08:40 1212613720 1
return_value = 0
[1212613720]RRA[LAST][1]DS[in] = 1.0000000000e+00
2008-06-04 23:08:45 1212613725 2
return_value = 0
[1212613725]RRA[LAST][1]DS[in] = 2.0000000000e+00
2008-06-04 23:08:50 1212613730 3
return_value = 0
[1212613730]RRA[LAST][1]DS[in] = 3.0000000000e+00
2008-06-04 23:08:55 1212613735 4
return_value = 0
[1212613735]RRA[LAST][1]DS[in] = 4.0000000000e+00


Rgds

- Karl




More information about the rrd-users mailing list