[rrd-users] how correctly make speed graphics

Simon Hobson linux at thehobsons.co.uk
Wed May 25 13:13:42 CEST 2011


moose wrote:

>the problem is that the value is unreal!
>
>why
>
>  "DEF:in=$rdb:IN:AVERAGE "
>
>shows the value which I need
>and
>  "GPRINT:in:AVERAGE:Speed IN\\: \%6.2lf kbyte",
>
>shows something unreal
>
>http://rrd-mailinglists.937164.n2.nabble.com/file/n6402194/graphic-daily_1.png

What value do you expect ? Looking at that graph, I'd expect 
something in the order of 60-something k.


In situations like this, it is well worth making yourself a set of 
test data - ie a fixed set up update instructions which put known 
data into a freshly created RRD file. That way, you can calculate 
exactly what should come out, and you can repeat the test as often as 
you like without the data (and expected results) changing every time.

I would strongly suggest doing this since you seem to be struggling 
to grasp some of the basics of how RRD works - it will really help 
you.

An example of how you could do this is :

#!/bin/bash
rm testfile.rrd
rrdtool create testfile.rrd --start 1306317900 --step 300 \
   DS:test:COUNTER:600:0:U \
   RRA:AVERAGE:0.5:1:10 \
   RRA:AVERAGE:0.5:5:2

rrdtool update testfile.rrd 1306317000:U
rrdtool update testfile.rrd 1306317300:300
rrdtool update testfile.rrd 1306317600:600
rrdtool update testfile.rrd 1306317900:900
rrdtool update testfile.rrd 1306318200:1200
rrdtool update testfile.rrd 1306318500:1500
rrdtool update testfile.rrd 1306318800:1500
rrdtool update testfile.rrd 1306319100:1200
rrdtool update testfile.rrd 1306319400:900
rrdtool update testfile.rrd 1306319700:600
rrdtool update testfile.rrd 1306320000:300
rrdtool update testfile.rrd 1306320300:U

That will create data that starts at 1306317000 where it steps up to 
a **rate** of 1/s, ramps up to a **rate** of 5/s, and then ramps down 
again. If you plot from 1306317000 to 1306320000 in a graph, then you 
should see this, and should see an average of 3. If you plot the 
1500s (5 * 300s) resolution data, then you should just see two blocks 
of 3.

Note - it is important to understand that the update at time 
1306317300 sets the rate for the 300s leading up to that time. So the 
rate is 1 from 1306317000 to 1306317300, and **NOT** from 1306317300 
to 1306317600.

Obviously, you can fiddle with the data to your heart's content until 
you understand what's going on and have the right outputs.

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the rrd-users mailing list