RRDtool computing logic help

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RRDtool computing logic help

aleluya
Hi, everyone,

I am learning RRDtool, I can't find any documents that describe what would happen when multiple sampling points were inserted in a single step.

Here's my test:

rrdtool create mydata6.rrd --start 1396419600 --step 4 DS:mem:GAUGE:2000:0:4000000 RRA:AVERAGE:0.5:1:50

rrdtool updatev mydata6.rrd 1396419601:8 1396419604:14

I got the output:
return_value = 0
[1396419604]RRA[AVERAGE][1]DS[mem] = 1.2500000000e+001

In the example above, the step is 4 seconds, I insert two sampling points whose value are 8 and 14 respectively, why I got the CDP value 12.5?

What's the internal logic?
Are there any documents describing the computing logic of rrdtool in more detail?

Reply | Threaded
Open this post in threaded view
|

Re: RRDtool computing logic help

Simon Hobson
aleluya <[hidden email]> wrote:

> I am learning RRDtool, I can't find any documents that describe what would
> happen when multiple sampling points were inserted in a single step.

http://www.vandenbogaerdt.nl/rrdtool
See his tutorial on Rates, normalizing and consolidating

> Here's my test:
>
> rrdtool create mydata6.rrd --start 1396419600 --step 4
> DS:mem:GAUGE:2000:0:4000000 RRA:AVERAGE:0.5:1:50
>
> rrdtool updatev mydata6.rrd 1396419601:8 1396419604:14
>
> I got the output:
> return_value = 0
> [1396419604]RRA[AVERAGE][1]DS[mem] = 1.2500000000e+001
>
> In the example above, the step is 4 seconds, I insert two sampling points
> whose value are 8 and 14 respectively, why I got the CDP value 12.5?

You had one second @ 8 somethings/s, and 3 seconds at 14 somethings/s.

(8 * 1) + (14 * 3) = 50
50 / 4 = 12.5

Or calculating it another way :

8 * (1/4) = 2
14 * (3/4) = 10.5
2+10.5 = 12.5



_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: RRDtool computing logic help

rseiwert
In reply to this post by aleluya
Since no one else replied, I'll take a swing at this.

RRDTool will build it's buckets on the step boundary from the epoch. Since one element is not exactly on the boundary RRD will interpolate the data received.

If you don't want RRD fudging your numbers you need to enter data exactly on the step boundary.

Using your example I put in data at 4 and 8 seconds and got

rrdtool updatev mydata6.rrd 1396419604:8 1396419608:14
return_value = 0
[1396419604]RRA[AVERAGE][1]DS[mem] = 8.0000000000e+00
[1396419608]RRA[AVERAGE][1]DS[mem] = 1.4000000000e+01