BW patches for innreport..

Fabien Tassin fta at sofaraway.org
Sun Jan 14 15:30:43 UTC 2001



Here is a patch for innreport that adds a bandwidth graph in the index
page. This already is in the diablo and cyclone ports for years but
I've changed the unit (KB vs Kb). I think innreport should not use
KB/s (kilo byte per sec) at all. It is a confusing unit. "Kb/s" or "Mb/s"
(b for bit) should be used instead. No patch for that yet.

news at newsfeed:~/etc $ diff -c innreport.conf.orig innreport.conf
*** innreport.conf.orig Sat Nov 18 01:34:31 2000
--- innreport.conf      Sun Jan 14 15:56:00 2001
***************
*** 95,100 ****
--- 95,116 ----
                          value   "val6";       # Outgoing feeds: Accepted
                };
        };
+       graph {
+               title         "Bandwidth";
+               value         val1;
+               color         "#FFFFCE";
+               unit          "Kb";
+               data {
+                         name    "Incoming";
+                         color   "#50A0D0";
+                         value   "byte(val4)";       # Incoming feeds: Volume
+               };
+               data {
+                         name    "Outgoing";
+                         color   "#0000FF";
+                         value   "byte(val7)";       # Outgoing feeds: Volume
+               };
+       };
  };
  
  ###########################################################################

news at newsfeed:~/bin $ diff -c innreport.orig innreport
*** innreport.orig      Mon Jan  1 22:46:28 2001
--- innreport   Sun Jan 14 15:55:18 2001
***************
*** 2330,2337 ****
  sub kb2i {
    my $s = shift;
    my ($i, $u) = $s =~ m/^(\S+) (\S+)$/;
!   $i *= 1024 if $u =~ m/MB/o;
!   $i *= 1024 * 1024 if $u =~ m/GB/o;
    return $i;
  }
  
--- 2330,2337 ----
  sub kb2i {
    my $s = shift;
    my ($i, $u) = $s =~ m/^(\S+) (\S+)$/;
!   $i *= 1024 * 8 if $u =~ m/MB/o;
!   $i *= 1024 * 1024 * 8 if $u =~ m/GB/o;
    return $i;
  }
  


-- 
Fabien Tassin -+- fta at sofaraway.org



More information about the inn-patches mailing list