From b323b33f60e19303058c65d3e0af7e1f7ee171dd Mon Sep 17 00:00:00 2001 From: Matt Sergeant Date: Wed, 15 Jun 2005 20:34:34 +0000 Subject: [PATCH] More cleanup git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@433 958fd67b-6ff1-0310-b445-bb7760255be9 --- plugins/stats | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/stats b/plugins/stats index 92e0f4e..fbe0119 100644 --- a/plugins/stats +++ b/plugins/stats @@ -1,6 +1,5 @@ #!/usr/bin/perl -w -use Qpsmtpd::Stats; use Time::HiRes qw(time); my $START_TIME = time; @@ -16,11 +15,12 @@ sub register { } sub get_stats { - my $uptime = Qpsmtpd::Plugin::stats->uptime; - my $recvd = Qpsmtpd::Plugin::stats->mails_received; - my $reject = Qpsmtpd::Plugin::stats->mails_rejected; - my $soft = Qpsmtpd::Plugin::stats->mails_tempfailed; - my $rate = Qpsmtpd::Plugin::stats->mails_per_sec; + my $class = shift; + my $uptime = $class->uptime; + my $recvd = $class->mails_received; + my $reject = $class->mails_rejected; + my $soft = $class->mails_tempfailed; + my $rate = $class->mails_per_sec; return sprintf(" Uptime: %0.2f sec\n". " Mails Received: % 10d\n". " 5xx: % 10d\n". @@ -67,7 +67,8 @@ sub mails_tempfailed { } sub mails_per_sec { - return ($MAILS_RECEIVED / uptime()); + my $class = shift; + return ($MAILS_RECEIVED / $class->uptime()); }