From:  "Brian J. Murrell" <br...@interlinx.bc.ca>
   Date: Wed, 21 Jan 2009 19:15:19 +0000 (UTC)
   
   I'm trying to figure out why in some cases, spamd is taking in excess of 
   1200s to process messages.  Is there any way to profile (i.e. time, or 
   timestamp) each of the tests that spamd is doing so I can see where the 
   longest ones are?

   Even enabling the kind of debug that "spamassassin -D" produces, along 
   with timestamps for each line of debug would be useful.
   
Somebody else posted this a while back.

Do spamassassin -D < email.txt 2>&1 | timestamp

where timestamp is a .function defined in .bashrc :

  function timestamp()
  { perl -MPOSIX -MTime::HiRes -n -e '
      BEGIN {$|=1; $dp=0; $t0=Time::HiRes::time};
      $t=Time::HiRes::time; $dt=$t-$t0; printf("%s%06.3f %4.3f %4.3f %s",
        POSIX::strftime("%H:%M:",localtime($t)), $t-int($t/60)*60,
        $dt, $dt-$dp, $_); $dp=$dt' $*
  }

Or pipe it directly to the one liner:

spamassassin -D < email.txt 2>&1 | perl -MPOSIX ....

-jeff

Reply via email to