You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by "Brian J. Murrell" <br...@interlinx.bc.ca> on 2009/01/21 20:15:19 UTC

profile the various tests being done

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.

I've tried to use -D with spamd but I don't see any debug being logged 
anywhere (i.e. not in /var/log/mail.info along with the rest of spamd's 
log output).

Cheers,
b.


Re: profile the various tests being done

Posted by Jeff Mincy <je...@delphioutpost.com>.
   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