[rrd-users] Fetching from the beginning of an RRD file

Travis Spencer travislspencer at gmail.com
Fri Mar 2 06:49:56 CET 2007

On 2/28/07, Alex van den Bogaerdt <alex at ergens.op.het.net> wrote:

Hey Alex,

Thanks for the reply.  I really appreciate your willingness to help me
get to the bottom of this.

> Think of the database as a wheel.  There is no beginning nor an end.

OK, but time isn't a wheel; it's linear and on that line epoch occurs
before the second of January 2007 (the date corresponding to
1167724800 that I used in my previous example).

> There is a pointer to the last entry written.  That's the most recent
> available data.  Next to it is older, next to that one is older, and
> so on.  When you are back at the pointer, you have seen all available
> data.

While I have no doubt that is how RRD handles things internally, I was
thinking of it more like this: Each RRD file is a database.  That
database contains one table for each CF (e.g., AVERAGE, MIN, etc.).
Each table has a number of columns (e.g., DS, DST, timestamp, etc.).
Given all of this, I was thinking of my initial example:

rrdtool fetch foo.rrd AVERAGE -s 0

to be analogous to this SQL:


Perhaps I'm looking at this wrong; however, even if RRD is storing its
data internally in a wheel-like structure, I would think that all of
that data would be returned if I ask it to fetch me its averages that
were entered more recently than epoch.  To fulfill such a request, it
would have to analyze echo row of its datastore upon which it would
see that all were entered after Jan. 1, 1970.  Thus, the above
execution of rrdtool, should give me all values from the "beginning"
to the "end".

> If you didn't know this, perhaps you should look at the documentation,

The documentation says, "-s [is a] time in seconds since epoch."  Zero
is certainly such a time.

Thanks again, Alex, for the help.



Travis Spencer

More information about the rrd-users mailing list