You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/01/14 06:47:54 UTC

svn commit: rev 6162 - incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin

Author: felicity
Date: Tue Jan 13 21:47:54 2004
New Revision: 6162

Modified:
   incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/BayesStore.pm
Log:
bug 2822: output more expiry data for debugging purposes.  includes a
table output with atime/expiry counts.  should help with people asking
why expiry doesn't work.


Modified: incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/BayesStore.pm
==============================================================================
--- incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/BayesStore.pm	(original)
+++ incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/BayesStore.pm	Tue Jan 13 21:47:54 2004
@@ -562,7 +562,7 @@
   #   if the two values are out of balance, estimating atime is going to be funky, recompute
   #
   if ( (time() - $magic[4] > 86400*30) || ($magic[8] < 43200) || ($magic[9] < 1000) || ($newdelta < 43200) || ($ratio > 1.5) ) {
-    dbg("bayes: something fishy, calculating atime (first pass)");
+    dbg("bayes: Can't use estimation method for expiry, something fishy, calculating optimal atime delta (first pass)");
     my $start = 43200; # exponential search starting at ...?  1/2 day, 1, 2, 4, 8, 16, ...
     my %delta = (); # use a hash since an array is going to be very sparse
     my $max_expire_mult = 512; # $max_expire_mult * $start = max expire time (256 days), power of 2.
@@ -588,6 +588,12 @@
       }
     }
 
+    dbg("bayes: atime\ttoken reduction");
+    dbg("bayes: ========\t===============");
+    for( my $i = 1; $i<=$max_expire_mult; $i<<=1 ) {
+	dbg("bayes: ".$start*$i."\t".(exists $delta{$i} ? $delta{$i} : 0));
+    }
+
     # Now figure out which max_expire_mult value gives the closest results to goal_reduction, without
     # going over ...  Go from the largest delta backwards so the reduction size increases
     # (tokens that expire at 4 also expire at 3, 2, and 1, so 1 will always be the largest expiry...)
@@ -618,6 +624,7 @@
     }
 
     $newdelta = $start * $max_expire_mult;
+    dbg("bayes: First pass decided on $newdelta for atime delta");
   }
   else { # use the estimation method
     dbg("bayes: Can do estimation method for expiry, skipping first pass.");