[rrd-users] rate per day graph from rate per hour DS
griffithba at gmail.com
Tue Jan 30 07:07:30 CET 2007
Thanks Alex! With your help I think I've got it all figured out.
On 1/29/07, Alex van den Bogaerdt <alex at ergens.op.het.net> wrote:
> On Mon, Jan 29, 2007 at 05:34:33PM -0500, Ben Griffith wrote:
> > Hi,
> > I have a RRD that was defined as follows:
> > rrdtool create $sensor.rrd -s 3600 \
> > DS:minutes:ABSOLUTE:3600:0:60 \
> > RRA:MAX:0.5:1:4800
> > Once per minute the RRD is updated with a 1 if my boiler is running, or
> a 0
> > if it is not.
> An update at 19:01 describes time 19:00 to 19:01.
> If your boiler was switched off a fraction of a second before you ran
> your rrdtool command, you will update with a wrong status.
> This will of course be countered by the opposite: your boiler switched
> on a fraction of a second ago and you note "1" where the real status
> should have been "0".
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.
Your step size is 3600 seconds. Each minute you add another portion
> of the hourly statistics, I think using an averaging computation.
> (not 100% sure, but pretty sure)
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?
> > I tried supplying start and end times in the DEF, but the boundaries are
> > still always placed at 19:00. How can I change that?
> Find a way to work with 24 hourly values instead of 1 daily value.
This is the method I chose. Here's what I came up with:
timenow=`date | sed 's/:/\\\:/g'`
rrdtool graph /home/griffith/public_html/boiler_day.png \
--end 00\:00 --start end-7d --x-grid
--height 200 --width 500 --imgformat PNG \
--title "Boiler run-time per day" --vertical-label "minutes" \
DEF:day1=$filename:minutes:MAX:start="midnight yesterday -
DEF:day2=$filename:minutes:MAX:start="midnight yesterday -
DEF:day3=$filename:minutes:MAX:start="midnight yesterday -
DEF:day4=$filename:minutes:MAX:start="midnight yesterday -
DEF:day5=$filename:minutes:MAX:start="midnight yesterday -
DEF:day6=$filename:minutes:MAX:start="midnight yesterday -
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
Thanks again, Alex.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rrd-users