<br><br><div><span class="gmail_quote">On 1/30/07, <b class="gmail_sendername">Simon Hobson</b> <<a href="mailto:linux@thehobsons.co.uk">linux@thehobsons.co.uk</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ben Griffith wrote:<br><br>>Doesn't it just add up all the entries to get a total for the hour,<br>>then from that a rate per second? Or does it actually compute the<br>>rate throughout the hour, on the fly?
<br><br>No, it ALWAYS computes an average/max/min depending on what you set<br>in the rrd. Also, you NEED to use average or your figures are<br>guaranteed to be wrong. For example, suppose we just look at 4<br>samples :<br>
<br>1 1 0 0<br><br>Clearly your boiler was running for half the time (give or take a bit<br>due to the sampling), and average would give you 0.5. Max would give<br>you 1 for any period where the boiler ran at all which is not what
<br>you want.</blockquote><div><br>The 1 1 0 0 are counter values, so they are added together and then divided by the step interval. In this case, if the interval was 4 minutes (240 seconds) that would mean 2/240. Since I've set up the RRA to contain only one step (size 1 hour), it's like Alex said: "MIN(x) = MAX(x) = AVG(x) = LAST(x) if there's only one x." If I had said the step size was 15 minutes and the RRA contained 4 of them then I'd be in trouble. I didn't know how all of that worked when I set it up, so I guess I just lucked out. I think I've got it now though. I agree that even though MAX works just fine in this case it is misleading.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">><br>>filename=/usr/local/misterhouse/trunk/data/rrd/Burner_Counter.rrd<br>
>timenow=`date | sed 's/:/\\\:/g'`<br>>rrdtool graph /home/griffith/public_html/boiler_day.png \<br>> --end 00\:00 --start end-7d --x-grid<br>>DAY:7:DAY:7:DAY:1:86400:%A \<br>> --height 200 --width 500 --imgformat PNG \
<br>> --title "Boiler run-time per day" --vertical-label "minutes" \<br>> DEF:day1=$filename:minutes:MAX:start="midnight<br>>yesterday - 6d":end=start+23h \
<br><br>Two things wrong here (I think) :<br><br>First, you don't want max, you want average (see above)<br><br>Second, I think you need "start+24h" not "start+23h"</blockquote><div><br>That's what I thought too, but "start+24h" and "start+1d" both gave me 25 hours of data instead of 24, and my "bars" overlapped from midnight to 1am. The totals are correct when I use +23h. I guess by saying start is "midnight yesterday" I get that first hour, and then I want 23 more hours, not 24.
<br><br>That doesn't seem right. Did I find a bug? I'm using 1.2.15-r3 from Gentoo portage.<br></div><br>-Ben</div>