I just committed the modular-graph code to trunk: r1051.

Hopefully, it doesn't break anything horribly for anyone.

Rehashing this from the original email I posted a while back:

Each chart is generated from a specific .php file, with graph.php
acting as a gatekeeper for the specific graphing files.  There is one
file per report (Load, CPU, Network, etc), a generic metric.php for
reporting individual metrics, and a heavily commented
"sample_report.php" file.  Gone is the huge if/else block for all of
the different graph types.  Various sanitation and check routines are,
I hope, more clearly laid out as well.  I've mentioned work to help
with sanitizing all _GET/_COOKIE (et al) variables, and that code is
similar to this section of the modular-graph patch.

Adding a new report should now be straightforward:
 1) Add a new report file named "<namehere>_report.php" in web/graphs.d/
 2) Add the report name to the $optional_graphs variable in conf.php.

This should also help down the road during the hypothetical UI
overhaul.  Since the graphs are split more cleanly, it should easier
for the front end code (and users) to request specific graphs.

This nicely reflects the complexity of the various reports.  The
individual metrics are, by far, the most complicated, as there is
different handling depending on context.  The sample_report is
actually just the CPU_report, but has about 50 lines of comments on
how the graphs are created.

I have been using this patch "in production" for quite a while now,
and it works for me.

-- 
Jesse Becker
GPG Fingerprint -- BD00 7AA4 4483 AFCC 82D0 2720 0083 0931 9A2B 06A2

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to