[rrd-users] how correctly make speed graphics

Simon Hobson linux at thehobsons.co.uk
Tue May 24 14:30:03 CEST 2011


moose wrote:

>But there is one more problem  with "Speed IN" and "Speed OUT" in comments
>
>as you can see the Average speed is near 80kb/s

Actually, I see nothing of the sort !
Assuming the data starts at the beginning of the first hump on the 
graph, I'd say the average is significantly less than 80k. There are 
several low values (including something that is either zero or close 
to it) in the graph.

>but Speed IN shows ~32000kb/s

Could be.
Try using rrd fetch to dump the contents of the relevant CF and see 
what the average of the values actually work out to.

>graphics are drawing from the script with such command
>
>     rrdtool graphv graphic-daily_1.png \
>     -w500
>     -h100
>     -b 1024
>     --title     Daily
>     --start     -12h
>     --end       $now
>     --imgformat PNG
>     --interlace
>     DEF:in=$rdb:IN:AVERAGE
>     DEF:out=$rdb:OUT:AVERAGE
>     DEF:in_ex=$rdb:IN_EX:AVERAGE
>     DEF:out_ex=$rdb:OUT_EX:AVERAGE
>     AREA:in#00DD00:in
>     LINE1:out#F15500:out
>     AREA:in_ex#FF0000:in_ex
>     LINE1:out_ex#0561FA:out_ex
>     GPRINT:in:LAST:Speed IN\\: \%6.2lf kbyte
>     GPRINT:out:LAST: OUT\\: \%6.2lf kbyte
>
>I tried to insert "GPRINT:in:AVERAGE:Speed IN\\: \%6.2lf kbyte"
>but  "Speed IN" shows the same wrong speed, and I can not imagine where it
>takes that number

When you use the LAST function in GPRINT, I'm not sure how it is 
treated when the only consolidation you have is AVERAGE. I suspect it 
may be consolidating the "in" CDEF to a single figure using AVERAGE 
(which is the CF used in calculation "in") and then applying LAST. It 
cannot show you the LAST value of the data because you aren't storing 
that.

-- 
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