[rrd-developers] Patch to get more metadata out of 'rrdtool graph'

Mark Plaksin happy at usg.edu
Mon Nov 26 21:09:00 CET 2007


Tobias Oetiker <tobi at oetiker.ch> writes:

> Hi Mark,

Hi again:

Sorry (again!) for the long delay.

> Congratulations. This is looking much better ...
>
> there are a few things though ...
>
> a) instead of looking at grinfoh to be NULL, info_push could look
>    at grinfoc to be NULL and NOT push.

You mean grinfo_push instead of info_push, right?  In any case I don't
understand you.  Are you trying to eliminate one of the arguments that
has to be passed to grinfo?

It seems like the "is this the first item in the list" logic has to
either be in grinfo_push or in every function that calls grinfo_push.
In my patch grinfo_push is called in graph_paint and
graph_size_location.  If more graph info is pushed at some point it
might be in other function(s).  So I thought it was better to put the
first time logic in grinfo_push itself.

> b) you added an additional parameter to the default rrd_graph call
>    this will break existing code. Use a NEW rrd_graph call which
>    adds this additional parameter. (similar to
>    rrd_graph_in_memory).And create a wrapper for this function with
>    the old name, keeping the old interface and capabilities.

Maybe I'm dense because I don't follow this either :)  I understand not
wanting to break existing code but I'm not sure exactly what you're
suggesting.  My gut wants to add an optional argument to rrd_graph so
that old code continues to work but maybe it's not that simple (I'm no C
wizard as you probably guessed!).

If I guess at what you mean here's what I come up with: You want
HandleInputLine in main.c to call rrd_graph_in_memory.  The existing
rrd_graph function gets renamed to rrd_graph_tobi and I add my argument
to it.  A new rrd_graph function gets created which has the same
arguments as rrd_graph_tobi and does nothing more than call
rrd_graph_tobi with something special in place of my argument so no
grinfo_push calls are made.  And rrd_graph_in_memory also gets my extra
parameter and calls rrd_graph_tobi.  But that sounds crazy so I don't
think I've understood you.

Thanks for your patience!



More information about the rrd-developers mailing list