Attached patch to ganglia-3.0.5 causes the network graphs to be rendered as
bits/sec instead of bytes/sec.

Seeing as network capacties are usually measured in bits/sec, this seems
like a sensible default.

-- 
Caleb Epstein
diff -ur ganglia-3.0.5/web/graph.php /pub/www/monitor/ganglia/graph.php
--- ganglia-3.0.5/web/graph.php 2007-10-03 00:48:43.000000000 -0400
+++ /pub/www/monitor/ganglia/graph.php  2007-11-02 16:26:50.880590000 -0400
@@ -217,12 +217,14 @@
 
             $lower_limit = "--lower-limit 0 --rigid";
             $extras = "--base 1024";
-            $vertical_label = "--vertical-label 'Bytes/sec'";
+            $vertical_label = "--vertical-label 'bits/sec'";
 
             $series = "DEF:'bytes_in'='${rrd_dir}/bytes_in.rrd':'sum':AVERAGE "
                ."DEF:'bytes_out'='${rrd_dir}/bytes_out.rrd':'sum':AVERAGE "
-               ."LINE2:'bytes_in'#$mem_cached_color:'In' "
-               ."LINE2:'bytes_out'#$mem_used_color:'Out' ";
+               ."CDEF:'bits_in'='bytes_in',8,* "
+               ."CDEF:'bits_out'='bytes_out',8,* "
+               ."LINE2:'bits_in'#$mem_cached_color:'In' "
+               ."LINE2:'bits_out'#$mem_used_color:'Out' ";
          }
       else if ($graph == "packet_report")
          {
@@ -285,6 +287,18 @@
       $rrd_file = "$rrd_dir/$metricname.rrd";
       $series = "DEF:'sum'='$rrd_file':'sum':AVERAGE "
          ."AREA:'sum'#$default_metric_color:'$subtitle' ";
+
+      // Make network graphs bits/sec
+      if ($metricname == "bytes_in" or $metricname == "bytes_out")
+      {
+          $series = "DEF:'sum'='$rrd_file':'sum':AVERAGE "
+              ."CDEF:'bits'='sum',8,* "
+              ."AREA:'bits'#$default_metric_color:'$subtitle' ";
+
+          $metricname  = "network" . substr ($metricname, 5);
+          $vertical_label = "--vertical-label 'bits/sec'";
+      }
+
       if ($jobstart)
          $series .= "VRULE:$jobstart#$jobstart_color ";
     }
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ganglia-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to