[rrd-users] Re: rrdtool export

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Mar 2 12:56:54 MET 2004

On Tue, Mar 02, 2004 at 02:40:15AM -0500, Rick Blundell wrote:
> Would you mind posting these scripts?  I just want to calculate the
> average or total for a column of data.

Average:  just use "rrdtool graph" with PRINT (not Gprint)
Total:  as above, but multiply the average by the time span

Graphic displays 9 intervals of 300 seconds each.  The rates are:

The total timespan of this graph would be 300*9 seconds.

The average rate would be: 5

RRDtool would normally display this rate on the graph, using GPRINT.
Take such a grapher script and remove all LINE, AREA and STACK.
Change GPRINT into PRINT.  Remove unwanted PRINTs.  You now have
the average rate.

To compute the total (on the graph or in a report doesn't matter)
you can multiply the average by the amount of time.

First the "normal" way:

rate 1:  valid during 300 seconds, total = 300*1
rate 2:  valid during 300 seconds, total = 300*2
rate 3:  valid during 300 seconds, total = 300*3
...and so on
rate 9:  valid during 300 seconds, total = 300*9
------------------------------------------------  sum
                    9*300 seconds, total = 300*45

Total is 13500, in 2700 seconds.

Other way to compute:
Average rate is 5.  Amount of time is 2700.
Amount of bytes is 5*2700= 13500.

Same answer, without knowing each individual interval.

Multiplying can be done using a CDEF.


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