innreport bug in INN-CURRENT - patch applied
Yury B.Razbegin
yur at simtel.ru
Thu Dec 6 08:16:00 UTC 2001
Innreport does not count "elapsed time", because of
nnrpd syslog record format changing.
For correction of this defect I offer attached patch.
--
* Yury B.Razbegin * yur at simtel.ru * +7 (-8422) -35-32-09 (Fax: -41-00-19) *
-- Attached file included as plaintext by Ecartis --
-- Desc: innreport patch for INN-CURRENT
--- samples/innreport.conf.in Thu Dec 6 10:50:20 2001
+++ samples/innreport.conf.in.orig Wed Dec 5 13:00:54 2001
@@ -2117,20 +2117,16 @@
title "NNRP total resource statistics:";
data "%nnrpd_resource";
column {
- name "Code region";
+ name "User";
format_name "%10s";
- format "%13s";
+ format "%10.3f";
value "$key";
- format_total "TOTAL: %-8.8s";
- total "time(total(%nnrpd_times))";
};
column {
name "Time";
format_name "%10s";
format "%13s";
value "time_ms($nnrpd_resource{$key})";
- value "time($nnrpd_resource{$key})";
- total "time(total(%nnrpd_resource))";
};
};
--- scripts/innreport_inn.pm Thu Dec 6 10:51:48 2001
+++ scripts/innreport_inn.pm.orig Wed Dec 5 13:01:00 2001
@@ -1282,21 +1282,15 @@
return 1;
}
# times
- if ($left =~ m/^(\S+)\s+ times\s+ # customur & time
- ((?:\S+\ \d+\.\d+\s*)+) # timer values
- $/ox) {
- my ( $cust, $timers ) = ($1, $2);
+ if ($left =~ /(\S+) times user (\S+) system (\S+) elapsed (\S+)$/o) {
+ my ($cust, $user, $system, $elapsed) = ($1, $2, $3, $4);
$cust = lc $cust unless $CASE_SENSITIVE;
my $dom = &host2dom($cust);
-
- while ($timers =~ /(\S+) (\d+\.\d+)\s*/g) {
- my ($name, $value) = ($1, $2);
- $nnrpd_resource{$name} += $value;
- if ($name =~ /elapsed/i ) {
- $nnrpd_times{$cust} += $value;
- $nnrpd_dom_times{$dom} += $value;
- }
- }
+ $nnrpd_times{$cust} += $elapsed;
+ $nnrpd_resource{'user'} += $user;
+ $nnrpd_resource{'sys'} += $system;
+ $nnrpd_resource{'elapsed'} += $elapsed;
+ $nnrpd_dom_times{$dom} += $elapsed;
return 1;
}
# artstats
More information about the inn-bugs
mailing list