[rrd-users] Re: PERCENT question

Leif Neland leif at neland.dk
Wed Dec 28 16:39:36 MET 2005


---- Original Message ----
From: <rodrigo.santos at quantiza.com>
To: "Leif Neland" <leif at neland.dk>
Cc: <rrd-users at list.ee.ethz.ch>
Sent: Wednesday, December 28, 2005 2:08 PM
Subject: [rrd-users] Re: PERCENT question

> Yes, this is my question: "How many percent is the subnet traffic of
> the total?"
> 
> using RPN expressions, I have:
> 
> subnet = 0.059110
> total  = 0.176248
> using RPN expression 100,subnet,*,total,/ i have 12.02%
> 
> but using a calculator, where:
> 100 * subnet   = 5.911  / total = 33.53%
> subnet / total = 0.3353 * 100   = 33.53%
> 
> What is the problem with RPN expressions??
> 
I did a "constant" CDEF:
CDEF:t=t4,t4,-,100,0.059110,*,0.176248,/,+
GPRINT:t:LAST:%5.2lf

It gives correctly 33.54, as expected. 


( t4,t4,- (equals zero) is just a quick trick to avoid the message:
ERROR: Cannot parse vname from 'CDEF:100,0.059110,*,0.176248,/ )

Post the entire script using the RRD.

Leif





--
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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list