[rrd-users] Newbie question: Always missing the last datapoint in rrdtool graphs

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Thu Feb 26 15:35:36 CET 2009


----- Original Message ----- 
From: "Ole Holm Nielsen" <Ole.H.Nielsen at fysik.dtu.dk>
To: "Alex van den Bogaerdt" <alex at vandenbogaerdt.nl>
Cc: <rrd-users at lists.oetiker.ch>
Sent: Thursday, February 26, 2009 3:24 PM
Subject: Re: [rrd-users] Newbie question: Always missing the last 
datapoint in rrdtool graphs


> Alex van den Bogaerdt wrote:
>> Updates are describing the past: 
>> http://www.vandenbogaerdt.nl/rrdtool/after_the_fact.php
>>
>> More info on UTC: http://www.vandenbogaerdt.nl/rrdtool/timezone.php
>>
>> Most people don't look at midnight to midnight local time. They 
>> look at midnight to midnight UTC time.
>
> Thanks a lot for your tutorials and explanation!  This is most 
> enlightening.
> It's beginning to dawn upon me that the RRD databases always use UTC 
> internally.
>
> The problem I'm seeing is that when I create a database that starts 
> on
> Tue 01 Jan 2002 12:00:00 AM CET (New Year in my local timezone):
>
> # rrdtool create test.rrd --start 1009839600 --step 86400 \
>   DS:running:GAUGE:86400:0:U RRA:AVERAGE:0.5:1:3650
>
> then internally rrdtool doesn't do what I intended, since it seems 
> to shift
> the timestamps from 00:00:00 CET to 01:00:00 CET = 00:00:00 UTC:
>
> # rrdtool dump test.rrd
> ...
>   <database>
>      <!-- 1992-01-04 01:00:00 CET / 694483200 --> <row><v> NaN 
> </v></row>
> ...
>
> The quick answer is presumably that this shows rrdtool working as 
> designed!?

yep.


> However, I do NOT want to look at midnight to midnight UTC time, I 
> really
> must look at midnight to midnight local time!  The reason for this 
> requirement
> is that our Linux cluster, which operates with the Torque Resource 
> Manager
> (a batch job system), generates daily accounting files in *local 
> time*, i.e.,
> for each day in local time a file is created named like "20090226".

Sure.  And how many hours are there in such a day?
The answer will be: 363 or 364 times 24 hours, 1 time 23 hours and 1 
time 25 hours.

This is not really a problem, as long as you remember this when you do 
tricks like multiplying the average rate by the amount of time to get 
total bytes transfered.

> So the natural period of time for my system is from 00:00:00 until 
> 23:59:59
> local time, not UTC time (please do not suggest to fix the Torque 
> software
> to use UTC!).

I won't.

What you can do: work using UTC yourself.  That's on the page 
describing timezones.  If you can get 'TZ="UTC" date' working, you can 
also get 'TZ="UTC" rrdtool' working.


Update at midnight UTC (I mean: using the timestamp which is midnight 
UTC), using the values you want to be in your database.

Then create your graph with: 'TZ="UTC" rrdtool graph ...' in stead of 
just 'rrdtool graph ...'

This should work.



More information about the rrd-users mailing list