INN commit: trunk (samples/innreport.conf.in scripts/innreport_inn.pm)

INN Commit Russ_Allbery at isc.org
Tue Dec 19 23:56:00 UTC 2006


    Date: Tuesday, December 19, 2006 @ 15:56:00
  Author: eagle
Revision: 7595

Fix a syntax error in the previous innreport work.  Allow for both the
current logs with rejected size and the older logs without it.  Remove
an extraneous column from the incoming volume report.  Fix a logic bug
that caused none of the incoming sum variables to be populated.

Modified:
  trunk/samples/innreport.conf.in
  trunk/scripts/innreport_inn.pm

---------------------------+
 samples/innreport.conf.in |    6 ------
 scripts/innreport_inn.pm  |   26 ++++++++++++--------------
 2 files changed, 12 insertions(+), 20 deletions(-)

Modified: samples/innreport.conf.in
===================================================================
--- samples/innreport.conf.in	2006-12-13 04:35:35 UTC (rev 7594)
+++ samples/innreport.conf.in	2006-12-19 23:56:00 UTC (rev 7595)
@@ -659,12 +659,6 @@
                                      (total(%innd_accepted_sum) +
 	                              total(%innd_rejected_sum)))";
 	};
-        column {
-                name          "Elapsed";
-		format        "%9s";
-		value         "time($innd_seconds_sum{$key})";
-		total         "time(total(%innd_seconds_sum))";
-        };
 	graph {
 	        title         "Incoming Volume received by server";
 		type          histo3d;

Modified: scripts/innreport_inn.pm
===================================================================
--- scripts/innreport_inn.pm	2006-12-13 04:35:35 UTC (rev 7594)
+++ scripts/innreport_inn.pm	2006-12-19 23:56:00 UTC (rev 7595)
@@ -363,7 +363,7 @@
     # our totals.  On a closed, clear any checkpoint numbers and add the close
     # numbers to the totals.  Basically, we want to ignore checkpoints unless
     # we don't get a close before the end of the log.
-    if ($left =~ /(\S+:\d+) (checkpoint|closed) seconds (\d+) accepted (\d+) refused (\d+) rejected (\d+) duplicate (\d+) accepted size (\d+) duplicate size (\d+) rejected size (\d+)$/o) {
+    if ($left =~ /(\S+:\d+) (checkpoint|closed) seconds (\d+) accepted (\d+) refused (\d+) rejected (\d+) duplicate (\d+) accepted size (\d+) duplicate size (\d+)(?: rejected size (\d+))?$/o) {
       my ($server, $status, $seconds, $accepted, $refused, $rejected, $duplicate, $accptsize, $dupsize, $rjctsize) =
 	($1, $2, $3, $4, $5, $6, $7, $8, $9, $10);
       $server = lc $server unless $CASE_SENSITIVE;
@@ -377,7 +377,7 @@
         $innd_cp_stored_size{$server}     = $accptsize;
         $innd_cp_duplicated_size{$server} = $dupsize;
         $innd_cp_rejected_size{$server}   = $rjctsize;
-      elsif ($status eq "closed") {
+      } elsif ($status eq "closed") {
         $innd_cp_accepted{$server}        = 0;
         $innd_cp_refused{$server}         = 0;
         $innd_cp_rejected{$server}        = 0;
@@ -1868,18 +1868,16 @@
     # Sum all incoming traffic for each full server.
     foreach $key (keys (%innd_connect)) {
       ($hostname, $channel) = split(':', $key);
-      if (defined($innd_seconds_sum{$hostname})) {
-        $innd_seconds_sum{$hostname} += $innd_seconds{$key};
-        $innd_connect_sum{$hostname} += $innd_connect{$key};
-        $innd_offered_sum{$hostname} += $innd_offered{$key};
-        $innd_accepted_sum{$hostname} += $innd_accepted{$key};
-        $innd_refused_sum{$hostname} += $innd_refused{$key};
-        $innd_rejected_sum{$hostname} += $innd_rejected{$key};
-        $innd_stored_size_sum{$hostname} += $innd_stored_size{$key};
-        $innd_duplicated_size_sum{$hostname} += $innd_duplicated_size{$key};
-        $innd_offered_size_sum{$hostname} += $innd_offered_size{$key};
-        $innd_rejected_size_sum{$hostname} += $innd_rejected_size_sum{$key};
-      }
+      $innd_seconds_sum{$hostname} += $innd_seconds{$key};
+      $innd_connect_sum{$hostname} += $innd_connect{$key};
+      $innd_offered_sum{$hostname} += $innd_offered{$key};
+      $innd_accepted_sum{$hostname} += $innd_accepted{$key};
+      $innd_refused_sum{$hostname} += $innd_refused{$key};
+      $innd_rejected_sum{$hostname} += $innd_rejected{$key};
+      $innd_stored_size_sum{$hostname} += $innd_stored_size{$key};
+      $innd_duplicated_size_sum{$hostname} += $innd_duplicated_size{$key};
+      $innd_offered_size_sum{$hostname} += $innd_offered_size{$key};
+      $innd_rejected_size_sum{$hostname} += $innd_rejected_size_sum{$key};
     }
 
     # adjust min/max of innd timer stats.



More information about the inn-committers mailing list