You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2004/09/23 15:44:19 UTC

[Bug 3808] New: Code to aid in Spamd statistics

http://bugzilla.spamassassin.org/show_bug.cgi?id=3808

           Summary: Code to aid in Spamd statistics
           Product: Spamassassin
           Version: 3.0.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: spamc/spamd
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: danm@prime.gushi.org


Per Justin Mason's suggestion, I am opening this "bug" for spamd to be able to 
write to a statistics file.

I had originally thought I would log via syslog to a pipe with the following 
code:

---

while (<STDIN>) {
   $stats{spam}++  if /identified spam/;
   $stats{clean}++ if /clean message/;
   $stats{skipped}++       if /skipped large/;
   $stats{total}++         if /connection from/;
   $stats{processed}++     if /processing message/;
   $counter++;
   if $counter eq $flushinterval {
     &flush;
   }
   
   # possibly something here to roll the values over
   # at the 32-bit boundary to prevent them from
   # getting huge, in true MRTG fashion.


};

sub flush {
open OUTPUT, ">/var/log/spamstats";
print OUTPUT <<EOF
Spam: $stats{spam}
Skipped: $stats{skipped}
Total: $stats{total}
Processed: $stats{processed}
EOF
close OUTPUT;

---

However, I realized it would save the use of an open pipe and an open file 
handle if this sort of functionality were available within spamd's parent 
process itself.

Example command line switches:

--scoreboard-file Path to the statistical scoreboard file
--scoreboard-dump-interval Frequency (in number of messages handled) that the 
scoreboard is flushed to disk.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.