On Thu, Jul 19, 2012 at 8:54 AM, Jochen Hein <joc...@jochen.org> wrote:
> Vladimir Vuksan <vli...@veus.hr> writes:
>
>> I would define a scaling factor or some other variable. I do want to
>> steer away from having tool specific options unless absolutely
>> necessary.
>
> I agree that would be a useful goal, I just have no idea what I options
> I may need for my special problem [see my mail to ganglia-general].
>
> I've had a look at the other PHP-reports. A couple of them pass the
> option '--rigid' to rddtool. Other used options are --logarithmic and
> --lower-limit. I've no idea how that could be mapped into json and keep
> the syntax and the parsing simple.

Speaking as the one who wrote[1] a good chunk of the original "modular
report" code, the idea for for the 'extras' variable is to allow the
report writer to make whatever changes to make the graph look the way
they want.  This includes overriding the default settings.  The
various options cited, such as --rigid and --logarithmic, are perfect
examples.

Quoting from graph.php:

/* The $extras variable is used for other arguemnts that may not
 * fit nicely for other reasons.  Complicated requests for --color, or
adding --ridgid, for example.
 * It is simply a way for the graph writer to add an arbitrary options
when calling rrdtool, and to
 * forcibly override other settings, since rrdtool will use the last
version of an option passed.
 */

Note that this *predates* JSON support, and when I wrote the code,
there had been zero mention of any other backends other than rrdtool.
It's worth nothing that a lot, perhaps even "most", of the graphing
code is rrdtool specific.

However, I don't see any particular reason why the JSON code in
graph.php should not make use of the 'extras' graph variable.  Short
of re-writing the "graphing API" (so to speak), this seems a
reasonable solution in the short term.  I agree with Vladimir that
something generic is preferable, but I expect that something
"sufficiently generic" won't be much use.  We'll have a data structure
that includes a handful of values for "title", "x/y label", and a
massive string or array of
"all_the_other_options_for_this_graph_type".



[1] Or "screwed up horribly," take your pick.


-- 
Jesse Becker

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to