oetiker / rrdtool-2.x

RRDtool 2.x - The Time Series Database
86 stars 8 forks source link

More flexibility in VDEF/CDEF etc #3

Open sshipway opened 11 years ago

sshipway commented 11 years ago

It should be possible to use the value of a VDEF in a CDEF, plus more of the RPN functions in general in a VDEF. We should also remove the requirement to have at least one DS in a CDEF This would allow, for example, things such as -

Of course, you'd need to be careful to identify circular references between CDEFs and VDEFs...

ab-it commented 11 years ago

VDEF is just a combination of (rate,time). Use the rate component where it makes sense, use the time component where it makes sense. If there is no time component, set it to a specific number (please see the initial code), if there is no rate component then set it to a specific number (probably NaN, but please see the initial code).

"It should be possible to use the value of a VDEF in a CDEF". Isn't it anymore? When starting this, you could place a VDEF name anywhere (in CDEF) where you could use a number. E.g. a fictional VDEF returning the number of bits in a byte could be used like: CDEF:bps=Bps,vdefnamehere,*

HRULE without DS: used to be possible; please check the changes Used to work: HRULE:95#FF0000:95th

VRULE at maximum: possible. Or at least it used to be. Compute the maximum in a VDEF. The value pair contains maximum, and time. When using it to draw VRULE, it uses the time component, et presto. Used to work: VDEF:max=inbytes,MAXIMUM HRULE:max#FF0000 VRULE:max#FF0000

(example code from memory, may need some tweaking)