[rrd-users] CDEF / VDEF / PRINT / GRPRINT limitations & workarounds

Karl Fischer rrd-users at ficos.de
Sun Jul 6 13:11:26 CEST 2008


Alex van den Bogaerdt wrote:
> On Sun, Jul 06, 2008 at 12:08:03PM +0200, Karl Fischer wrote:
> 
>> over the last couple of days I kept constantly fooling myself with
>> the current limitations of CDEF / VDEF / PRINT / GRPRINT ...
>>
>> * CDEF needs at least one vname from DEF or CDEF (not VDEF)
> 
> Correct, mostly.  You can use VDEF here, as long as the CDEF would
> support a number.
> 
> E.g.:  CDEF:newds0=ds0,8,*
> also:  CDEF:newds0=ds0,somevdef,*
> where that vdef would result in 8

yeah, but the problem is more that *at least one* vname for CDEF
needs to be from (C)DEF, so

CDEF:new=vdef1,vdef2,-

doesn't work and has to be rewritten into something like

CDEF:new=someoldds,UN,vdef1,vdef1,IF,vdef2,-


> For HRULE:  why not use LINE1  ?
> 
> If it is a matter of autoscaling (HRULE doesn't extend the scale)
> then I suggest the more flexible modification of introducing a new
> parameter to LINEx (e.g.  ":optional" to indicate you don't necessarily
> want to see this line -> doesn't effect autoscaling).

that would be *perfect* - that's what I need!


>> So I need to have another workaround like this:
>>
>> VDEF:dfD=dfDelta,LAST
>> GRPINT:dfD:%+9.3lf %sB
> 
> Doesn't
> GPRINT:dfDelta:LAST:%+9.3lf %sB
> work ?
> (that won't work for FIRST though!)

haven't tried that because the man pages say:
GPRINT:vname:CF:format (deprecated)


>> Since CDEF *can* work with vnames from VDEF, why does it want to
>> have at least one (C)DEF vname? Could this be changed easily?
> 
> VDEF results in a number (a pair actually). Now see next answer.
> 
>> Why doesn't CDEF accept rpns without a (C)DEF vname?
> 
> Because that would mean it's a constant.

not quite true - it's a calculated constant, meaning:
It doesn't vary over the time period show, but it isn't a constant

I needed it for the LINEx:optional thing you mentioned above.
Use VDEF/MAXIMUM to find out about the current yscale and then use
LIMIT to only show the line if it fit's the scale ...

I also needed it to calculate with two VDEF values ...

since this doesn't work:

VDEF:dfFirst=dfUsed,FIRST
VDEF:dfLast=dfUsed,LAST
CDEF:dfDelta=dfLast,dfFirst,-    # doesn't work
GRPINT:dfFirst:%8.3lf %sB
GRPINT:dfLast:%8.3lf %sB
GRPINT:dfDelta:%+9.3lf %sB

I wrote it like this (as said before)

VDEF:dfFirst=dfUsed,FIRST
VDEF:dfLast=dfUsed,LAST
CDEF:dfD=dfUsed,UN,dfLast,dfLast,IF,dfFirst,-
VDEF:dfDelta=dfD,LAST
GRPINT:dfFirst:%8.3lf %sB
GRPINT:dfLast:%8.3lf %sB
GRPINT:dfDelta:%+9.3lf %sB


>> And last: if these workarounds are the only way to achieve this,
>> wouldn't they be worth a few lines in the documentation/examples?
> 
> No matter what is in the docs, it is never enough and at the same
> time it is always too much.

probably true ... that's why I mentioned examples ...


Thanks Alex for your explanations ...
However, especially the thing with VDEF vs. constants isn't quite
clear as shown above (for me, VDEF isn't necessarily a constant!?)

Rgds

- Karl



More information about the rrd-users mailing list