[rrd-users] Understanding RRD's; Question #1

Dave Bodenstab imdave at mcs.net
Fri Feb 23 06:36:19 MET 2001


I'm trying to understand what's going on with rrdtool
so I've been creating a test rrd file and examining
the results.

My first question has to do with time.  I do this:

  $ rrdtool create test.rrd \
  		--start '12 am 1/1/2001' \
		--step 86400 \
		DS:one:ABSOLUTE:86400:U:U \
		RRA:LAST:0.5:1:5

  # I've deleted the portions of the following output that
  # are not related to my question...
  $ rrdtool dump test.rrd
  <!-- Round Robin Database Dump -->
  <rrd>
	  <version> 0001 </version>
	  <step> 86400 </step> <!-- Seconds -->
	  <lastupdate> 978328800 </lastupdate> <!-- 2001-01-01 00:00:00 CST -->
  <!-- Round Robin Archives -->
	  <rra>
		  <database>
			  <!-- 2000-12-27 18:00:00 CST / 977961600 --> <row><v> NaN </v></row>
			  <!-- 2000-12-28 18:00:00 CST / 978048000 --> <row><v> NaN </v></row>
			  <!-- 2000-12-29 18:00:00 CST / 978134400 --> <row><v> NaN </v></row>
			  <!-- 2000-12-30 18:00:00 CST / 978220800 --> <row><v> NaN </v></row>
			  <!-- 2000-12-31 18:00:00 CST / 978307200 --> <row><v> NaN </v></row>
		  </database>
	  </rra>
  </rrd>

  # Just to verify that the numeric time values above are shown
  # correctly as local time...
  $ date -d '0:0:0 1/1/1970 utc' +%s
  0
  $ date -d '0:0:0 1/1/1970 utc' 
  Wed Dec 31 18:00:00 CST 1969
  $ date -d '0:0:0 1/1/1970 utc + 978328800 sec'   # <lastupdate> time
  Mon Jan  1 00:00:00 CST 2001
  $ date -d '0:0:0 1/1/1970 utc + 978307200 sec'   # last <row> time
  Sun Dec 31 18:00:00 CST 2000
  $ bc				# difference is 6 hours (CST)
  978328800-978307200
  21600
  21600/3600
  6

So, the <lastupdate> time is from --start, but the <row> times are
offset by 6 hours (CST).

My question: why are the time slots offset by my time zone?  Seems
to me that the internal times should either all be local or all be
universal.  As the rrdupdate man page states: ``Getting the timing
right to the second is especially important...''.  When I give the
start time, then rrdcreate should use that time to set up the time
slots in the rra.  It seems to me that the current behavior is a bug.

If I use rrdupdate to enter values throughout a day, the values
will fall into two different slots... not very intuitive.

Some additional info: if I change the --start time by 6 hours, then
the <lastupdate> time is set appropriately, but the <row> time slots
are *always* offset by 6 hours.  How do I get the time slots to be
aligned to an exact day???!


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list