[rrd-users] CDEF / VDEF / PRINT / GRPRINT limitations & workarounds
Alex van den Bogaerdt
alex at ergens.op.het.net
Sun Jul 6 12:38:00 CEST 2008
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
> * VDEF can't do rpn calculations
correct
> * PRINT / GRPINT / HRULE only accept vnames from VDEF, not CDEF
Incorrect for PRINT and GPRINT. The 'old-style' command still works
as far as I know (or was it removed in recent versions?)
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).
[snip comments about needing workarounds]
Yes, that happens.
> Now I have created a solution that has to calculate dfDelta for each
> of the datapoints rather than once at the end - this is not what I
> would call effictient, and still, now that the calculation is done,
> the dfDelta still cannot be (G)PRINTed since it is a CDEF value :-(
> 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!)
> So the general question(s) is/are:
>
> Why these limitations?
For VDEF: because it was implemented quick (enough) and dirty. It
was a limited implementation because of demand. If many people
demand more from it, someone can extend it.
> Are there better ways (than mine above) to do this?
If rpn for VDEF is important enough for you, please invest either
time+skills, or money.
> 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. If so, you can just use
that constant instead of a VDEF. Why would you want to use:
CDEF:x=10
CDEF:y=ds0,x,+
instead of
CDEF:y=ds0,10,+
?
> Where does the limitation of not beeing able to do rpn calculations
> with VDEF come from?
See under limitations.
> 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.
HTH
--
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/
More information about the rrd-users
mailing list