More cleanup
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@433 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
9fbf25a708
commit
b323b33f60
@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
use Qpsmtpd::Stats;
|
|
||||||
use Time::HiRes qw(time);
|
use Time::HiRes qw(time);
|
||||||
|
|
||||||
my $START_TIME = time;
|
my $START_TIME = time;
|
||||||
@ -16,11 +15,12 @@ sub register {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub get_stats {
|
sub get_stats {
|
||||||
my $uptime = Qpsmtpd::Plugin::stats->uptime;
|
my $class = shift;
|
||||||
my $recvd = Qpsmtpd::Plugin::stats->mails_received;
|
my $uptime = $class->uptime;
|
||||||
my $reject = Qpsmtpd::Plugin::stats->mails_rejected;
|
my $recvd = $class->mails_received;
|
||||||
my $soft = Qpsmtpd::Plugin::stats->mails_tempfailed;
|
my $reject = $class->mails_rejected;
|
||||||
my $rate = Qpsmtpd::Plugin::stats->mails_per_sec;
|
my $soft = $class->mails_tempfailed;
|
||||||
|
my $rate = $class->mails_per_sec;
|
||||||
return sprintf(" Uptime: %0.2f sec\n".
|
return sprintf(" Uptime: %0.2f sec\n".
|
||||||
" Mails Received: % 10d\n".
|
" Mails Received: % 10d\n".
|
||||||
" 5xx: % 10d\n".
|
" 5xx: % 10d\n".
|
||||||
@ -67,7 +67,8 @@ sub mails_tempfailed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub mails_per_sec {
|
sub mails_per_sec {
|
||||||
return ($MAILS_RECEIVED / uptime());
|
my $class = shift;
|
||||||
|
return ($MAILS_RECEIVED / $class->uptime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user