<br><div><span class="gmail_quote">On 1/30/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 Tue, Jan 30, 2007 at 01:07:30AM -0500, Ben Griffith wrote:<br><br><br>> I could try updating more frequently. I think I'd have to<br>> adjust the rate multiplier accordingly. So if I update every 15 seconds I'd
<br>> have to multiply by 900 (number of seconds in an hour divided by the number<br>> of 15 second blocks in a minute) instead of 3600 to get the number of<br>> minutes the boiler was on in an hour.<br><br>If you feel a minute to be close enough, by all means keep it this way.
</blockquote><div><br>I thought about it some more and decided it would be a good idea to collect at a smaller interval, and still report in minutes. So I'll probably change it to collect every 10 seconds, which means I'll multiply by 600 to get the number of minutes per 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;">You are currently updating with "1" for an entire hour on, "0" for an
<br>entire hour off, and anything inbetween for a mix.<br><br>If the boiler is on at the start of a new hour, stays on for another<br>15 minutes, switches off and stays off during the rest of the hour, I<br>expect a number around
0.25/3600 in your database. Is this correct ?</blockquote><div><br>In fact, it isn't. It shows 15/3600.<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;">
When you look at your data (dump it, or fetch from it) you should see<br>numbers between 0 and 1/3600 (0.0 .. 2.7777778E-04).</blockquote><div><br>Yesterday between 3 and 4am the boiler ran for 15 minutes. I fetched yesterday's data and the entry from 4am was:
<br>1170061200: 4.1666666667e-03<br>which is 15/3600<br><br>30 minutes of run-time between 6 and 7am looks like this:<br>1170072000: 8.3333333333e-03<br>equal to 30/3600<br><br>So the data is stored as numbers between 0 and 60/3600.
<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)<br>><br>> Doesn't it just add up all the entries to get a total for the hour, then<br>> from that a rate per second? Or does it actually compute the rate
<br>> throughout the hour, on the fly?<br><br>I'm not sure what it does for "absolute". For "counter" it saves<br>the value multiplied by time, and at the end (when the PDP is moved<br>into an RRA) dividing by total time results in a rate.
</blockquote><div><br>I think the only difference between absolute and counter is that absolute is assumed to be reset to 0 on every read. So where a counter would read 1,3,7,7,9, an absolute would read 1,2,4,0,2. In both cases, assuming all five values were collected in the same interval, the stored value would be 9/stepsize. One of the tutorials points out that an absolute "stores the current value divided by the step interval." Since I'm updating more than once per step, in my case "current value" would be replaced by "sum of all the values submitted during the step interval," I think. The same tutorial says a COUNTER "will save the rate of change of the value over a step period." I guess that would be the difference between the last value in the current step and the last value in the previous step, divided by the step size.
<br>That's the same as what you said, except for the "multiplied by time" part.<br></div><div><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Try, in parallel with your current setup, to update another RRD using<br>GAUGE. You should end up with numbers like 0.25 (not divided by 3600)<br>which mean the boiler was on during a quarter of the interval (whatever<br>
interval).</blockquote><div><br>I tried this and have two step intervals collected now. The first is a partial interval, since I started some minutes after 2pm. The boiler was on for 22 minutes, according to the ABSOLUTE RRD. The GAUGE RRD shows a value of
5.6943858168e-01, but that's probably telling me the percentage of time the boiler was on since collection started, partway through the interval. During the second inverval the boiler was on for only two minutes and the GAUGE shows
3.3333333333e-02, which is 2/60. The step interval is still 1 hour, and updates are still happening once per minute. If I understand correctly, the result would still be the same (disregarding differences in accuracy due to sampling rate) no matter how frequently I update the gauge, unlike with the absolute. In fact, does the sampling rate even need to be constant?
<br><br>I guess I've still got some more experiments to try.<br><br>Thanks again for your help.<br><br>-Ben<br></div></div>