[rrd-users] Re: price graphing..
Alex van den Bogaerdt
alex at ergens.op.HET.NET
Wed Mar 6 18:58:44 MET 2002
Michael L. Hostbaek wrote:
> hmm... I am not sure if I understand correctly.. but anyhows.. but it be
> dead wrong to create a rrd like this:
>
> root at mail2 data/rrdtool# rrdtool create cpuprice.rrd --step 3600 \
> DS:price:GAUGE:18000:0:500 \
> RRA:AVERAGE:0.5:1:720 \
> > RRA:MAX:0.5:1:720 \
> > RRA:MIN:0.5:1:720
This sounds about right, provided that you think 720 hours
is enough, and prices are inbetween 0 and 500 inclusive.
> today I might get 5 different prices from my DB, tomorrow there might be
> 6 or even 10... All these values need to go in the rrd. So I should
> perhaps create a perl script, calculating the average of my prices. Then
> make 3 datasources, one for the average price (at this point of time),
> one for the maximum price, and one for the minimum price. (and they
> should all be GAUGE's) and then just make one RRA. How would I make that
If you want min,max,avg as input, just define three different
inputs (DSes). If you want RRDtool to keep track of min,max,avg
from one input, you need to do it the way you summarized above.
Make sure you understand what happens when RRDtool starts
consolidating numbers (this is described at faq.mrtg.org).
min(100,120,115) is different from avg(100,120,115) and so on.
> rrdtool create newcpu.rrd --step 3600 \
> DS:avprice:GAUGE:18000:0:500 \
> DS:maxprice:GAUGE:18000:0:500 \
> DS:minprice:GAUGE:18000:0:500 \
> RRA:AVERAGE:0.5:1:720
With these properties you will probably never have to worry
about consolidating. However, if you keep track of 800 rows
and you are going to graph all 800 rows onto an image of 400
pixels, RRDtool will consolidate two numbers at a time.
You would be graphing: avg(minprice[0],minprice[1])
in stead of: min(minprice[0],minprice[1])
This is solved by creating, and using, another RRA; one that
keeps track of minimum values.
HTH
--
__________________________________________________________________
/ 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