[rrd-users] Re: SUM with RPN ?

Alex van den Bogaerdt alex at ergens.op.HET.NET
Mon Aug 19 23:15:40 MEST 2002


l.johnson wrote:
> 
> Hi everybody,
> just trying to "simply" sum values 
> eg)
> tot =0
> tot= tot+ value at time t
> tot = tot + value at time t+1  and so on 
> 
> seems so easy, but no result with that kind of code:
> ...
> DEF:val=$RRDFILE:val:MAX
> CDEF:tot1=tot,PREV,UN,0,tot,IF              // not sure for the syntax, anyway .. always incorrect ! 
> CDEF:tot= tot1,val,+
> ...
> 
> in other words , did anybody test the use of PREV or PREV(vname) as described in the rrdgraph manual or http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/tutorial/cdeftutorial.html

???

If this example is in the tutorial, it is wrong.  I most certainly
didn't put it in there.

There's no relation whatsoever between PREV(tot1) and tot.

Anyway:

If "average" is "total/time"  then "total" is "average * time".

No need for complicated PREV statements.

-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

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



More information about the rrd-users mailing list