[otrs-cvs] CVS: otrs/Kernel/System/Web InterfaceAgent.pm, 1.11,
1.12 InterfaceCustomer.pm,1.9,1.10 InterfacePublic.pm,1.5,1.6
cvs-log at otrs.org
cvs-log at otrs.org
Thu Aug 24 10:17:31 CEST 2006
Update of /home/cvs/otrs/Kernel/System/Web
In directory lancelot:/tmp/cvs-serv11861/Kernel/System/Web
Modified Files:
InterfaceAgent.pm InterfaceCustomer.pm InterfacePublic.pm
Log Message:
added performance log feature in admin interface - its disabled per default
Index: InterfaceAgent.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Web/InterfaceAgent.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** InterfaceAgent.pm 22 Mar 2006 07:23:20 -0000 1.11
--- InterfaceAgent.pm 24 Aug 2006 07:17:29 -0000 1.12
***************
*** 1,5 ****
# --
# Kernel/System/Web/InterfaceAgent.pm - the agent interface file (incl. auth)
! # Copyright (C) 2001-2006 Martin Edenhofer <martin+code at otrs.org>
# --
# $Id$
--- 1,5 ----
# --
# Kernel/System/Web/InterfaceAgent.pm - the agent interface file (incl. auth)
! # Copyright (C) 2001-2006 OTRS GmbH, http://otrs.org/
# --
# $Id$
***************
*** 70,73 ****
--- 70,76 ----
$Self->{Debug} = $Param{Debug} || 0;
+ # performance log
+ $Self->{PerformanceLogStart} = time();
+
# --
# create common framework objects 1/3
***************
*** 93,97 ****
);
}
-
return $Self;
}
--- 96,99 ----
***************
*** 661,665 ****
# ->Run $Action with $GenericObject
print $GenericObject->Run();
!
}
}
--- 663,687 ----
# ->Run $Action with $GenericObject
print $GenericObject->Run();
! # log request time
! if ($Self->{ConfigObject}->Get('PerformanceLog')) {
! if (!$QueryString && $Param{Action}) {
! $QueryString = "Action=".$Param{Action};
! }
! my $File = $Self->{ConfigObject}->Get('PerformanceLog::File');
! if (open(OUT, ">> $File")) {
! print OUT time()."::Agent::".(time()-$Self->{PerformanceLogStart})."::$UserData{UserLogin}::$QueryString\n";
! close (OUT);
! $Self->{LogObject}->Log(
! Priority => 'notice',
! Message => "Response::Agent: ".(time()-$Self->{PerformanceLogStart})."s taken (URL:$QueryString:$UserData{UserLogin})",
! );
! }
! else {
! $Self->{LogObject}->Log(
! Priority => 'error',
! Message => "Can't write $File: $!",
! );
! }
! }
}
}
Index: InterfaceCustomer.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Web/InterfaceCustomer.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** InterfaceCustomer.pm 22 Mar 2006 07:23:20 -0000 1.9
--- InterfaceCustomer.pm 24 Aug 2006 07:17:29 -0000 1.10
***************
*** 1,5 ****
# --
# Kernel/System/Web/InterfaceCustomer.pm - the customer interface file (incl. auth)
! # Copyright (C) 2001-2006 Martin Edenhofer <martin+code at otrs.org>
# --
# $Id$
--- 1,5 ----
# --
# Kernel/System/Web/InterfaceCustomer.pm - the customer interface file (incl. auth)
! # Copyright (C) 2001-2006 OTRS GmbH, http://otrs.org/
# --
# $Id$
***************
*** 69,72 ****
--- 69,75 ----
$Self->{Debug} = $Param{Debug} || 0;
+ # performance log
+ $Self->{PerformanceLogStart} = time();
+
# --
# create common framework objects 1/3
***************
*** 687,691 ****
# ->Run $Action with $GenericObject
print $GenericObject->Run();
!
}
}
--- 690,714 ----
# ->Run $Action with $GenericObject
print $GenericObject->Run();
! # log request time
! if ($Self->{ConfigObject}->Get('PerformanceLog')) {
! if (!$QueryString && $Param{Action}) {
! $QueryString = "Action=".$Param{Action};
! }
! my $File = $Self->{ConfigObject}->Get('PerformanceLog::File');
! if (open(OUT, ">> $File")) {
! print OUT time()."::Customer::".(time()-$Self->{PerformanceLogStart})."::$UserData{UserLogin}::$QueryString\n";
! close (OUT);
! $Self->{LogObject}->Log(
! Priority => 'notice',
! Message => "Response::Customer: ".(time()-$Self->{PerformanceLogStart})."s taken (URL:$QueryString:$UserData{UserLogin})",
! );
! }
! else {
! $Self->{LogObject}->Log(
! Priority => 'error',
! Message => "Can't write $File: $!",
! );
! }
! }
}
}
Index: InterfacePublic.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Web/InterfacePublic.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** InterfacePublic.pm 22 Mar 2006 07:23:20 -0000 1.5
--- InterfacePublic.pm 24 Aug 2006 07:17:29 -0000 1.6
***************
*** 1,5 ****
# --
# Kernel/System/Web/InterfacePublic.pm - the public interface file
! # Copyright (C) 2001-2006 Martin Edenhofer <martin+code at otrs.org>
# --
# $Id$
--- 1,5 ----
# --
# Kernel/System/Web/InterfacePublic.pm - the public interface file
! # Copyright (C) 2001-2006 OTRS GmbH, http://otrs.org/
# --
# $Id$
***************
*** 66,69 ****
--- 66,72 ----
$Self->{Debug} = $Param{Debug} || 0;
+ # performance log
+ $Self->{PerformanceLogStart} = time();
+
# --
# create common framework objects 1/3
***************
*** 232,235 ****
--- 235,259 ----
# ->Run $Action with $GenericObject
print $GenericObject->Run();
+ # log request time
+ if ($Self->{ConfigObject}->Get('PerformanceLog')) {
+ if (!$QueryString && $Param{Action}) {
+ $QueryString = "Action=".$Param{Action};
+ }
+ my $File = $Self->{ConfigObject}->Get('PerformanceLog::File');
+ if (open(OUT, ">> $File")) {
+ print OUT time()."::Public::".(time()-$Self->{PerformanceLogStart})."::-::$QueryString\n";
+ close (OUT);
+ $Self->{LogObject}->Log(
+ Priority => 'notice',
+ Message => "Response::Public: ".(time()-$Self->{PerformanceLogStart})."s taken (URL:$QueryString)",
+ );
+ }
+ else {
+ $Self->{LogObject}->Log(
+ Priority => 'error',
+ Message => "Can't write $File: $!",
+ );
+ }
+ }
}
# --
More information about the cvs-log
mailing list