spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j.@apache.org
Subject svn commit: r501885 - /spamassassin/trunk/masses/log-grep-recent
Date Wed, 31 Jan 2007 16:29:07 GMT
Author: jm
Date: Wed Jan 31 08:29:07 2007
New Revision: 501885

URL: http://svn.apache.org/viewvc?view=rev&rev=501885
Log:
add a percentage

Modified:
    spamassassin/trunk/masses/log-grep-recent

Modified: spamassassin/trunk/masses/log-grep-recent
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/log-grep-recent?view=diff&rev=501885&r1=501884&r2=501885
==============================================================================
--- spamassassin/trunk/masses/log-grep-recent (original)
+++ spamassassin/trunk/masses/log-grep-recent Wed Jan 31 08:29:07 2007
@@ -64,10 +64,16 @@
   }
 }
 
+my $numtotal = 0;
+foreach my $m (keys %buckets) {
+  $numtotal += $buckets{$m};
+}
+
 warn "Month distribution:\n\n";
 my $cumul = 0;
 foreach my $m (sort { $a <=> $b } keys %buckets) {
   $cumul += $buckets{$m};
-  warn sprintf ("%8d  %8d  %2d-%d months old\n", $cumul, $buckets{$m}, $m, $m+1);
+  warn sprintf ("%8d (%3d%%)  %8d  %2d-%d months old\n",
+            $cumul, int($cumul / ($numtotal||0.001)), $buckets{$m}, $m, $m+1);
 }
 



Mime
View raw message