I have a request for an improvement to the ganglia webfrontend. In the
host_view, it would be nice if the metrics which do have units
associated with them also had the appropriate vertical label (the info
is there, so why not use it?). The most confusing are the bytes_in &
bytes_out metrics whose units are actually bytes/sec but the only label
on the graph is bytes. I have attached a patch which does this. What
do people think?
~Jason
--
/------------------------------------------------------------------\
| Jason A. Smith Email: [EMAIL PROTECTED] |
| Atlas Computing Facility, Bldg. 510M Phone: (631)344-4226 |
| Brookhaven National Lab, P.O. Box 5000 Fax: (631)344-7616 |
| Upton, NY 11973-5000 |
\------------------------------------------------------------------/
diff -uNr ganglia-webfrontend-2.5.2-dist/graph.php ganglia-webfrontend-2.5.2/graph.php
--- ganglia-webfrontend-2.5.2-dist/graph.php Wed Jan 29 14:01:14 2003
+++ ganglia-webfrontend-2.5.2/graph.php Mon Mar 3 17:31:03 2003
@@ -10,6 +10,7 @@
$max = escapeshellcmd( rawurldecode( $HTTP_GET_VARS["x"] ));
$min = escapeshellcmd( rawurldecode( $HTTP_GET_VARS["n"] ));
$value = escapeshellcmd( rawurldecode( $HTTP_GET_VARS["v"] ));
+$vl = escapeshellcmd( rawurldecode( $HTTP_GET_VARS["vl"] ));
# Assumes we have a $start variable (set in get_context.php).
@@ -183,7 +184,10 @@
if(is_numeric($min)) {
$lower_limit ="--lower-limit '$min' ";
}
- if($max || $min) {
+ if($vl) {
+ $vertical_label = "--vertical-label '$vl'";
+ }
+ else if($max || $min) {
$vertical_label ="--vertical-label '$min - $max' ";
}
diff -uNr ganglia-webfrontend-2.5.2-dist/host_view.php ganglia-webfrontend-2.5.2/host_view.php
--- ganglia-webfrontend-2.5.2-dist/host_view.php Wed Jan 29 14:01:14 2003
+++ ganglia-webfrontend-2.5.2/host_view.php Mon Mar 3 17:44:16 2003
@@ -56,6 +56,10 @@
$g_metrics[$name][value] = $v1[VAL];
$g_metrics[$name][units] = $v1[UNITS];
$graphargs = "c=$clusterURL&h=$host&v=$v1[VAL]&m=$name&r=$range&z=medium&jr=$jobrange&js=$jobstart";
+ if($v1[UNITS]) {
+ $encodeUnits = rawurlencode($v1[UNITS]);
+ $graphargs .= "&vl=$encodeUnits";
+ }
$g_metrics[$name][graph] = "<IMG HEIGHT=\"147\" WIDTH=\"395\" ALT=\"$host $metric\" ".
"SRC=\"./graph.php?$graphargs\">";
}