[rrd-developers] [PATCH]: SQRT/SORT/REV and SHIFT

David M. Grimes dgrimes at navisite.com
Mon Aug 30 14:50:06 MEST 2004


All,

Just merged into the development branch are some new CDEF functions and an
implementation of the SHIFT command as document in previous checkpoints.

Also included is a fix to the code which aligns multiple DEF's when they
were fetched using the start=/end=/step= overrides.

Also included is a fix to the SEGV when using LINE{1,2,3}/AREA/STACK with a
VDEF vname.

SHIFT was already documented, and the implementation is consistent with the
previous documentation.

SQRT is a new RPN operator which replaces the top of stack with the square
root of the top of stack.

SORT and REV (REVerse) work like this (from the updated docs):

-----8<-----
Pop one element from the stack. This is the count of items to be sorted (or
reversed). The top count of the remaining elements are then sorted (or
reversed) in place on the stack.

Example: CDEF:x=v1,v2,v3,v4,v5,v6,6,SORT,POP,5,REV,POP,+,+,+,4,/ 

This will compute the average of the values v1..v6 after removing the
smallest and largest.
-----8<-----

The example could be achieved by other (existing) means, but more complex
cases can be represented with SORT/REV that couldn't readily be duplicated
with existing operators.

Please comment (and test!),

Thanks,


 --Dave Grimes
   dgrimes at navisite.com



--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list