[rrd-users] Showing daily average ; from midnight to midnight local time

Simon Hobson linux at thehobsons.co.uk
Wed Dec 9 11:36:56 CET 2009


Jean-Yves Avenard wrote:

>For the power usage ; I want to show the data as follow:
>daily: midnight to midnight local time
>weekly: midnight of day -7 to midnight previous day local time
>monthly: midnight of day-30 to midnight previous day local time
>yearly: doesn't really matter.
>
>daily view is averaged per hour
>weekly view is averaged per day
>monthly view is averaged per day
>yearly view is averaged per month (30 days)
>
>I created the RRD with data being fed every minute and keeping
>consolidated data as follow:
>100 days of 1 minute average
>5 years of 5 minutes average
>5 years of 30 minutes average
>5 years of 1 hour average
>5 years of 2 hours average
>5 years of daily average
>
>Everything is nice and rosy but for the weekly and monthly view...
>The average isn't calculated from midnight to midnight local time ;
>even though I provide end and start data at those values.
>
>For the weekly view, the x-grid is 'HOUR:3:DAY:1:HOUR:24:86400:%a'
>As you can see on the weekly graph:
>http://htpc.avenard.org/power/?graph=2&view=week
>A plot doesn't start at midnight ; but around 11AM.
>
>I understand that this is UTC time ; I read
>http://www.vandenbogaerdt.nl/rrdtool/timezone.php and in particular
>this thread:
>http://groups.google.com/group/mailing.unix.rrd-users/browse_thread/thread/326e32b152c9f6a9
>
>Is there any way to make the plotted bar goes from midnight to
>midnight local time, and calculate the average of the data of a day
>(local time)?
>If I set TZ to UTC ; then obviously the x axis matches the graph
>perfectly ; but that's not what I want to do...

I believe the answer to that was given in the second of those links 
you posted. Essentially, you'll have to store data with a resolution 
of no worse than 1 hour, then use rrdtools to get data out by your 
wallclock days, stuff those values into another rrd database, and 
then graph those.

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the rrd-users mailing list