[rrd-users] Re: Still struggling with RRD & RPN. where's the pb, all looks good to me.

Hugo van der Kooij hvdkooij at vanderkooij.org
Mon Apr 26 23:21:51 MEST 2004


On Mon, 26 Apr 2004, Laurent LEVIER wrote:

> To build this, I defined the following:

Which I would translate as ...

>          'CDEF:Cnxs=input,300,LE,input,300,IF' \

IF (input < 300)
THEN Cnxs = input
ELSE Cnxs = 300

>          'CDEF:CnxsOrange=input,600,GE,300,input,IF' \

IF (input >= 600)
THEN CnxsOrange = 300
ELSE CnxsOrange = input

>          'AREA:Cnxs#00FF00' \
>          'STACK:CnxsOrange#FF9F00' \
>
> With this, I was expecting to have
> a green layer for values between 0 & 300
> A orange layer for values above 600
> Partial orange layer for values between 300 & 600.

Not quit. It means Cnxs is cut short at 300.

But Cnxsorange is cut if it exceeds 600 back to 300. Or else it will hold
input which might be anywhere from 0 to 599.

So if input is 450 you would get Cnxs=300 and Cnxsorange=450 which would
stack for a nice value of 750 which I think should be quite red.

You might want to do:
	CDEF:CnxsOrange=input,600,GE,300,input,300,-,IF

IF (input >= 600)
THEN CnxsOrange = 300
ELSE CnxsOrange = input-300


But my RPN is not perfect either so I might be utterly wrong here.

I would advise to use variables instead of hardcoded values. It would make
changing a perimeter an easy exercise instead of counting all occurrances
and hoping you did not miss one.

Hugo.

-- 
 All email sent to me is bound to the rules described on my homepage.
    hvdkooij at vanderkooij.org		http://hvdkooij.xs4all.nl/
	    Don't meddle in the affairs of sysadmins,
	    for they are subtle and quick to anger.

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