Hi all,

Sorry for the delay in replying ... life's been quite hectic lately.  Some 
comments:

> GMond To Do
> ------------------------
> [...]
> - Support for counters (metrics with +ve slope)

FWIW, I think this can be marked "done" (although it was more of a gmetad 
bug).  See:

http://ganglia.svn.sourceforge.net/viewvc/ganglia?view=rev&revision=878


> - gmond switching to a non-blocking IO model. [...]

I think this will have to stay in the wish-list for now.  I haven't had time 
to look into this.


> GMetad To Do
> ------------------------------

Do we still have time to add the patch for bug #120?

http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=120

I can probably spend the little bit of time necessary to get it into SVN.

> - Have the option to switch off displaying all the single-metric graphs.

See attached patch [add-show-graphs.diff] for comments.


> - Fix the pie-chart-generating code.

See attached patch [fix-pie.diff] for review (although it's pretty trivial).

Finally, how about adding host-specific metrics?  This allows some extra 
graphs based on a host's FQDN (I find this *very* useful).

I've attached a patch [host-specific.diff] that implements what we discussed 
earlier as the simplest way of achieving this.

Cheers,

Paul.




Index: monitor-core/web/pie.php
===================================================================
--- monitor-core/web/pie.php	(revision 1061)
+++ monitor-core/web/pie.php	(working copy)
@@ -279,10 +279,8 @@
 
       for( $j = ($this->center_y+$PIE_THICKNESS); $j > $this->center_y; $j-- ) {
 
-        $from = 0;
+        for( $from = 0, $p = 0; $p < $pie_count; $p++, $from = $to ) {
 
-        for( $p = 0; $p < $pie_count; $p++ ) {
-
           $to = $from + $angles[$p];
 
           if( $to > 360 )
@@ -299,13 +297,10 @@
         
           ImageFilledArc( $this->im, $this->center_x, $j, $this->diameter, $this->diameter, $from, $to, $new_color, IMG_ARC_PIE );
 
-          $from += $angles[$p];
         }
       }
    
-      $from = 0;
-  
-      for( $p = 0; $p < $pie_count; $p++ ) {
+      for( $from = 0, $p = 0; $p < $pie_count; $p++, $from = $to ) {
 
         $to = $from + $angles[$p];
         
@@ -314,10 +309,6 @@
         if( $to > 360 )
           $to = 360;
 
-        if ($to > 360) {
-          $to = 360;
-        }
-
         ImageFilledArc( $this->im, $this->center_x, $this->center_y, $this->diameter, $this->diameter, $from, $to, $color, IMG_ARC_PIE );
 
         $from += $angles[$p];
Index: monitor-core/web/get_context.php
===================================================================
--- monitor-core/web/get_context.php	(revision 1061)
+++ monitor-core/web/get_context.php	(working copy)
@@ -21,6 +21,8 @@
 	escapeshellcmd( clean_string( rawurldecode($_GET["ti"]) ) ) : NULL;
 $sort = isset($_GET["s"]) ?
 	escapeshellcmd( clean_string( rawurldecode($_GET["s"]) ) ) : NULL;
+$show_graphs = isset($_GET["sg"]) ?
+	escapeshellcmd(rawurldecode($_GET["sg"])) : NULL;
 $controlroom = isset($_GET["cr"]) ?
 	clean_number( rawurldecode($_GET["cr"]) ) : NULL;
 $hostcols = isset($_GET["hc"]) ?
Index: monitor-core/web/header.php
===================================================================
--- monitor-core/web/header.php	(revision 1061)
+++ monitor-core/web/header.php	(working copy)
@@ -348,6 +348,31 @@
       # Assign template variable in cluster view.
    }
 
+
+# If we are in the host context, allow user to switch on or off the RRD graphs.
+if ($context == "host")
+   {
+      $sg_menu = "<B>Show all graphs</B>&nbsp;&nbsp;";
+      # Present a width list
+      $sg_menu .= "<SELECT NAME=\"sg\" OnChange=\"ganglia_form.submit();\">\n";
+
+      $sg_menu .= "<OPTION VALUE=\"\" ";
+      if (!$show_graphs || $show_graphs != "no")
+            $sg_menu .= "SELECTED";
+            $sg_menu .= ">on\n";
+
+      $sg_menu .= "<OPTION VALUE=\"no\" ";
+      if ($show_graphs == "no")
+            $sg_menu .= "SELECTED";
+            $sg_menu .= ">off\n";
+
+      $sg_menu .= "</SELECT>\n";
+
+      # Assign template variable in cluster view.
+      $tpl->assign("show_graph_menu", $sg_menu );
+   }
+
+
 # Make sure that no data is cached..
 header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    # Date in the past
 header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); # always modified
Index: monitor-core/web/host_view.php
===================================================================
--- monitor-core/web/host_view.php	(revision 1061)
+++ monitor-core/web/host_view.php	(working copy)
@@ -140,7 +140,7 @@
    }
 
 # Show graphs.
-if ( is_array($g_metrics) && is_array($g_metrics_group) )
+if ( is_array($g_metrics) && is_array($g_metrics_group) && (!$show_graphs || $show_graphs != "no"))
    {
       ksort($g_metrics_group);
 
Index: monitor-core/web/templates/default/header.tpl
===================================================================
--- monitor-core/web/templates/default/header.tpl	(revision 1061)
+++ monitor-core/web/templates/default/header.tpl	(working copy)
@@ -33,7 +33,8 @@
      <TD COLSPAN="1">
      {metric_menu} &nbsp;&nbsp;
      {range_menu}&nbsp;&nbsp;
-     {sort_menu}
+     {sort_menu}&nbsp;&nbsp;
+     {show_graph_menu}
      </TD>
      <TD>
       <B>{alt_view}</B>
Index: monitor-core/web/host_view.php
===================================================================
--- monitor-core/web/host_view.php	(revision 1061)
+++ monitor-core/web/host_view.php	(working copy)
@@ -3,6 +3,11 @@
 
 $tpl = new TemplatePower( template("host_view.tpl") );
 $tpl->assignInclude("extra", template("host_extra.tpl"));
+$host_extra_filename = template("host_extra_${hostname}.php");
+if(file_exists($host_extra_filename))
+  {
+    $tpl->assignInclude("extra-host-specific", $host_extra_filename);
+  }
 $tpl->prepare();
 
 $tpl->assign("cluster", $clustername);
Index: monitor-core/web/templates/default/host_view.tpl
===================================================================
--- monitor-core/web/templates/default/host_view.tpl	(revision 1061)
+++ monitor-core/web/templates/default/host_view.tpl	(working copy)
@@ -64,6 +64,7 @@
 
  <HR>
 <!-- INCLUDE BLOCK : extra -->
+<!-- INCLUDESCRIPT BLOCK : extra-host-specific -->
 
 </TD>
 
Index: monitor-core/web/templates/default/header.tpl
===================================================================
--- monitor-core/web/templates/default/header.tpl	(revision 1061)
+++ monitor-core/web/templates/default/header.tpl	(working copy)
@@ -5,6 +5,7 @@
 <META http-equiv="Content-type" content="text/html; charset=utf-8">
 <META http-equiv="refresh" content="{refresh}{redirect}" >
 <LINK rel="stylesheet" href="./styles.css" type="text/css">
+<LINK rel="stylesheet" href="./multiple-graphs.css" type="text/css">
 </HEAD>
 <BODY BGCOLOR="#FFFFFF">
 

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to