[rrd-users] Sum of diff's

Leif Neland leif at neland.dk
Sat Jan 7 20:21:56 MET 2006


Every hour I record the number of items left for sale of something.
Once in a while, the stock gets filled.
I want to graph the sale every day. I obviously miss the sale during the 
hour, where the stock gets filled, but that can't be helped; I don't know 
how much is added to the stock.

CDEF:sale=PREV(stock),stock,-,0,MAX

Eg for each hour at the day, I have this:
Stock    Computed Sale
14        NaN
12        2
12        0
9           3
29        0        <- here at least 20 items are added to the stock
...
7        ..

So the total sale for this day is 27; I want only one point in the graph for 
this.
I only have hourly resolution for one week, so I somehow must have entered 
this value 27, when the data gets consolidated for only datapoint per day. 
If not, I will get registered a sale of 7, and the addition of 20 is lost.

Can this be done? Or must I each night extract the last 24 values, compute 
the sale, and enter it into another rrd?

Leif









--
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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list