46cda05112
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@410 958fd67b-6ff1-0310-b445-bb7760255be9
35 lines
483 B
Perl
35 lines
483 B
Perl
# $Id$
|
|
|
|
package Qpsmtpd::Stats;
|
|
|
|
use strict;
|
|
use Qpsmtpd;
|
|
use Qpsmtpd::Constants;
|
|
use Time::HiRes qw(time);
|
|
|
|
my $START_TIME = time;
|
|
our $MAILS_RECEIVED = 0;
|
|
our $MAILS_REJECTED = 0;
|
|
our $MAILS_TEMPFAIL = 0;
|
|
|
|
sub uptime {
|
|
return (time() - $START_TIME);
|
|
}
|
|
|
|
sub mails_received {
|
|
return $MAILS_RECEIVED;
|
|
}
|
|
|
|
sub mails_rejected {
|
|
return $MAILS_REJECTED;
|
|
}
|
|
|
|
sub mails_tempfailed {
|
|
return $MAILS_TEMPFAIL;
|
|
}
|
|
|
|
sub mails_per_sec {
|
|
return ($MAILS_RECEIVED / uptime());
|
|
}
|
|
|
|
1; |