[rrd-developers] Add `FETCH' command to rrdcached

Tobias Oetiker tobi at oetiker.ch
Wed Apr 8 20:52:35 CEST 2009


Hi Florian

Today Florian Forster wrote:

> I'm confused. Of course the call to ?rrdc_flush? is in the SVN
> repository ? my patch *removes* it. So after applying the patch, the
> call to ?rrdc_flush? is gone, which is exactly what you expected and
> presumable wanted to have..?

yes, your patch removes flush ... but it add two types of fetch
calls ... my point was about the place where the logic to go local
or remote happens, in graph or fetch and having the flush in graph
is the same logical issue as having the remote fetch call in graph.

> > >    Also, this keeps magic
> > >    out of `rrd_fetch' and keeps the distinction clear and easy:
> > >
> > >     * ?rrd_fetch? and ?rrd_fetch_r? are for local file access.
> > >     * ?rrdc_fetch? is for remote file access.
> >
> > hmmm the 'problem' is that through this only graph will benefit and
> > fetch will not, causing all code that uses both fetch and graph to not
> > be able to use the remote data access ...
>
> I don't see the problem: Previously, when a daemon address was given,
> ?rrd_fetch? sent a ?FLUSH? command then then read the local file. With
> the proposed patch, ?FLUSH + local file? is substituted by ?FETCH? only.
> Either way, the user gets up-to-date, albeit not from a local file in
> the latter case. In either case users or programs can configure the
> daemon using the environment variable.

you are talking about rrd_graph ... right ? my argument is not
about rrd_graph, but about the design of rrdtool. For rrd_graph the
idea is, that rrd_graph calls upon fetch to pull in the data ...
and does not concern itself with how or where to get the data from.
Your patch changes this by putting the logic for either going to
rrd_fetch or the daemon into rrd_graph. I would expect to enhance
rrd_fetch so that it can decide to go either local or via the
deamon to pull in the data ...

have a look at the rrd_fetch code and grep for libdbi, I think we
should do the following:

a) when the daemon is in operation and a normal filename is
   accessed, rrd_fetch will send a flush to the daemon and then access
   the file as usual

b) if a special syntax file is accessed with a name modeled
   after the libdbi approach, rrd_fetch calls upon the daemon to pull
   in the data from remote.

   the address could be something starting with

   rrdc//...

then things would work transparently for all applications using
rrd_fetch without modifications to the graph code at all.

cheers
tobi


-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-developers mailing list