[rrd-users] NAN and 0 in aggregate graphs
Alex van den Bogaerdt
alex at ergens.op.het.net
Mon Mar 31 15:29:28 CEST 2008
On Mon, Mar 31, 2008 at 02:07:54PM +0000, Simon Hobson wrote:
> Adam Jacob Muller wrote:
>
> >Right now I am solving this by doing something like:
> >
> >CDEF:field1_nz=%s,UN,0,field1,IF
> >CDEF:field2_nz=%s,UN,0,field2,IF
> >CDEF:field_total=field1_nz,field2_nz,+
> >
> >this works, but, on values where both are NAN this returns 0, it would
> >be much more preferable to return NAN here
>
>
> Hmm, looking at the doc pages it doesn't look like boolean operators
> (AND, OR) are provided,
er...
FALSE==0
TRUE==1 (in reality: TRUE==anything but 0)
\
x y \ + *
------------+--------------
FALSE FALSE | FALSE FALSE
FALSE TRUE | TRUE FALSE
TRUE FALSE | TRUE FALSE
TRUE TRUE | TRUE TRUE
If you want: if (x and y) then B else C:
then use CDEF: x,y,*,B,C,IF
(also see example in doc: replace A by x,y,*)
--
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/
More information about the rrd-users
mailing list