[rrd-users] Re: cdef + rpn
steve rader
rader at teak.wiscnet.net
Wed Jan 12 23:50:18 MET 2000
> From: "Neil Calvert"
> I have a problem converting a calculation to RPN and perhaps someone can
> help.
>
> The calculation I have to do is of the form :
>
> ( ( <octets per second> * 8 ) / <bandwidth in bits> ) * 100
>
> to return a percentage of bandwidth used.
>
> The two forms I've tried with CDEF are :
>
> o,8,*,b,/,100,*
This looks right:
o,8,* --> output_in_bits
output_in_bits,b,/ --> bandwidth_fraction
bandwidth_fraction,100,* --> percent bandwidth
I verifed with a graph of a T1 circuit:
[...]
CDEF:in_bits=input,8,*
CDEF:in_per2=input,8,*,1536000,/,100,*
[...]
GPRINT:in_bits:LAST:"%6.2lf last bits"
GPRINT:in_per2:LAST:"%6.2lf %% used last\n"
For example: when last is 352685... I get a graph
labels like
"352685.nn last bits 22.96 % used last"
and
352685/1536000*100 = 22.96 %
and the, ah, what?, converse is...
22.96/100*1536000 = 352665
Lastly, the scaled last output is 352 kbits/sec and
352 kbits / 1536 kbits = 22.91%
later
steve
- - -
systems guy
wiscnet.net
--
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
More information about the rrd-users
mailing list