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

Alex van den Bogaerdt alex at ergens.op.het.net
Wed Jun 4 22:47:13 CEST 2008

```On Wed, Jun 04, 2008 at 04:22:18PM -0400, Guy Fleegman wrote:
> 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.

Why?  You update every second (more or less) and your "buckets" are
five seconds each.

> 2008-06-04 16:10:45 (1212610245)
> return_value = 0
> [1212610245]RRA[LAST][1]DS[in] = 1.6794170000e+00
> [1212610245]RRA[LAST][1]DS[out] = 1.6794170000e+00
> [1212610245]RRA[LAST][1]DS[busyper] = 1.6794170000e+00

This is where the update occurs.  It's timestamp is a whole multiple of your
step size.

Now the new bucket is filled.  We start looking from now on, for the next bucket.

> 3
> 2008-06-04 16:10:46 (1212610246)
> return_value = 0

One second, which is 1/5th of your bucket, the rate is 3.

> 4
> 2008-06-04 16:10:47 (1212610247)
> return_value = 0

One second, which is 1/5th of your bucket, the rate is 4.

> 5
> 2008-06-04 16:10:48 (1212610248)
> return_value = 0
> 6
> 2008-06-04 16:10:49 (1212610249)
> return_value = 0
> 7
> 2008-06-04 16:10:50 (1212610250)
> return_value = 0

and so on for 5,6 and 7.

The time is a whole multiple of your step size again.  The bucket is complete.

You have: 3,4,5,6 and 7, each valid for 1 second _more_or_less_.
The resulting rate is:  1/5 * 3 + 1/5 * 4 + 1/5 * 5 + 1/5 * 6 + 1/5 * 7 = (3+4+5+6+7)/5 = 5.

> [1212610250]RRA[LAST][1]DS[in] = 5.1567116000e+00
> [1212610250]RRA[LAST][1]DS[out] = 5.1567116000e+00
> [1212610250]RRA[LAST][1]DS[busyper] = 5.1567116000e+00

So, why is it not exactly 5 ?   Because your intervals are not exactly one second.

Retry the updates, but this time with those timestamps instead of 'N', in a freshly
created database.

--
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/

```