Thanks Alex! With your help I think I've got it all figured out.<br><br><div><span class="gmail_quote">On 1/29/07, <b class="gmail_sendername">Alex van den Bogaerdt</b> <<a href="mailto:alex@ergens.op.het.net">alex@ergens.op.het.net
</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;">On Mon, Jan 29, 2007 at 05:34:33PM -0500, Ben Griffith wrote:<br>> Hi,
<br>><br>> I have a RRD that was defined as follows:<br>><br>> rrdtool create $sensor.rrd -s 3600 \<br>> DS:minutes:ABSOLUTE:3600:0:60 \<br>> RRA:MAX:0.5:1:4800<br>><br>> Once per minute the RRD is updated with a 1 if my boiler is running, or a 0
<br>> if it is not.<br><br>An update at 19:01 describes time 19:00 to 19:01.<br><br>If your boiler was switched off a fraction of a second before you ran<br>your rrdtool command, you will update with a wrong status.<br>
<br>This will of course be countered by the opposite: your boiler switched<br>on a fraction of a second ago and you note "1" where the real status<br>should have been "0".</blockquote><div><br>I thought of that, but I figured in the end the two cases would cancel each other out. I could try updating more frequently. I think I'd have to adjust the rate multiplier accordingly. So if I update every 15 seconds I'd have to multiply by 900 (number of seconds in an hour divided by the number of 15 second blocks in a minute) instead of 3600 to get the number of minutes the boiler was on in an hour.
<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;">Your step size is 3600 seconds. Each minute you add another portion<br>of the hourly statistics, I think using an averaging computation.
<br>(not 100% sure, but pretty sure)</blockquote><div><br>Doesn't it just add up all the entries to get a total for the hour, then from that a rate per second? Or does it actually compute the rate throughout the hour, on the fly?
<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>> I tried supplying start and end times in the DEF, but the boundaries are
<br>> still always placed at 19:00. How can I change that?<br><br>Find a way to work with 24 hourly values instead of 1 daily value.</blockquote><div><br>This is the method I chose. Here's what I came up with:<br>
<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 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 yesterday - 6d":end=start+23h \
<br> DEF:day2=$filename:minutes:MAX:start="midnight yesterday - 5d":end=start+23h \<br> DEF:day3=$filename:minutes:MAX:start="midnight yesterday - 4d":end=start+23h \<br> DEF:day4=$filename:minutes:MAX:start="midnight yesterday - 3d":end=start+23h \
<br> DEF:day5=$filename:minutes:MAX:start="midnight yesterday - 2d":end=start+23h \<br> DEF:day6=$filename:minutes:MAX:start="midnight yesterday - 1d":end=start+23h \<br> DEF:day7=$filename:minutes:MAX:start="midnight yesterday":end=start+23h \
<br> VDEF:minday1=day1,TOTAL \<br> VDEF:minday2=day2,TOTAL \<br> VDEF:minday3=day3,TOTAL \<br> VDEF:minday4=day4,TOTAL \<br> VDEF:minday5=day5,TOTAL \<br> VDEF:minday6=day6,TOTAL \
<br> VDEF:minday7=day7,TOTAL \<br> CDEF:foo1=day1,minday1,+,day1,- \<br> CDEF:foo2=day2,minday2,+,day2,- \<br> CDEF:foo3=day3,minday3,+,day3,- \<br> CDEF:foo4=day4,minday4,+,day4,- \
<br> CDEF:foo5=day5,minday5,+,day5,- \<br> CDEF:foo6=day6,minday6,+,day6,- \<br> CDEF:foo7=day7,minday7,+,day7,- \<br> AREA:foo1#ff0000 \<br> AREA:foo2#0000ff \
<br> AREA:foo3#ff0000 \<br> AREA:foo4#0000ff \<br> AREA:foo5#ff0000 \<br> AREA:foo6#0000ff \<br> AREA:foo7#ff0000 \<br> GPRINT:minday1:" %.0lf"\
<br> GPRINT:minday2:" %.0lf"\<br> GPRINT:minday3:" %.0lf"\<br> GPRINT:minday4:" %.0lf"\<br> GPRINT:minday5:" %.0lf"\
<br> GPRINT:minday6:" %.0lf"\<br> GPRINT:minday7:" %.0lf\n"\<br> COMMENT:"$timenow"<br><br></div><br></div>Using the CDEFs to add in and subtract out each point seems kind of silly but I couldn't figure out a better way to constrain each VDEF to the day it belonged in.
<br><br>Thanks again, Alex.<br><br>-Ben<br>