[rrd-users] Re: Percentages in RRDTool

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Sat Feb 10 01:23:48 MET 2001


Chris Marlow wrote:

> I understand how percentages get calculated, it was the proceedure for
> putting them in the graph I was unclear about.  But I think you may have
> helped.  For example, my graphing command currently looks as follows (In my
> Perl script):

You are getting the correct results however:
- you don't need to convert to bits
- you don't need the extra "100,*"

These two calculations, while correct in other scripts, are not
necessary.  You start with bytes per second.  Just compare to the
maximum *bytes* per second to save you one calculation.  Compare
to *maximum/100* to save you the other calculation.

You'd end up with

> 
>     $GraphCommand = $BinPath . " graph " . $WorkPath . $Machine . '
> -month.png '.
>      '--start -2678400 ' .
>      '--title="Interface traffic for ' . $Machine . '" ' .
>      '--vertical-label "bits per second" ' .
>      '--imgformat PNG ' .
>      '--color CANVAS#DDDDDD ' .
>      '--color BACK#EEEEEE ' .
>      '--height 350 ' .
>      '--width  600 ' .
>      'DEF:inoctets=' . $DatabaseFile . ':input:AVERAGE ' .
>      'DEF:outoctets=' . $DatabaseFile . ':output:AVERAGE ' .
 CDEF:inpercent=inoctects,"maximum speed attainable in bytes/100",/
 CDEF:outpercent=outoctects,"maximum speed attainable in bytes/100",/
>      'COMMENT:"                            Max           Average
> Last\n" ' .
>      'AREA:inbits#FFCC00:"Inbound Traffic " ' .
>      'GPRINT:inbits:MAX:"%10.4lf %sbps" ' .
>      'GPRINT:inbits:AVERAGE:"%10.4lf %sbps" ' .
>      'GPRINT:inbits:LAST:"%10.4lf %sbps\n" ' .
>      'LINE1:outbits#CC66FF:"Outbound traffic" ' .
>      'GPRINT:outbits:MAX:"%10.4lf %sbps" ' .
>      'GPRINT:outbits:AVERAGE:"%10.4lf %sbps" ' .
>      'GPRINT:outbits:LAST:"%10.4lf %sbps\n" ';

And ofcourse change "MAX:10.4lf %sbps" into "MAX %6.2lf%%" and so on.

(6.2lf%% will become 100.00% to <space><space>0.00%)

cheers,
alex

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list