[otrs-cvs]
Fred/Kernel/System/Fred DProf.pm, 1.4, 1.5 SQLLog.pm, 1.5,
1.6 SmallProf.pm, 1.8, 1.9
cvs-log at otrs.org
cvs-log at otrs.org
Sat Feb 2 12:44:21 GMT 2008
Comments:
Update of /home/cvs/Fred/Kernel/System/Fred
In directory lancelot:/tmp/cvs-serv26875/Kernel/System/Fred
Modified Files:
DProf.pm SQLLog.pm SmallProf.pm
Log Message:
Insert a function to find multi used sql statements. Implement a new sort option for DProf. Make sum rows for some module columns.
Author: tr
Index: DProf.pm
===================================================================
RCS file: /home/cvs/Fred/Kernel/System/Fred/DProf.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DProf.pm 30 Nov 2007 16:48:41 -0000 1.4
--- DProf.pm 2 Feb 2008 12:44:16 -0000 1.5
***************
*** 1,5 ****
# --
# Kernel/System/Fred/DProf.pm
! # Copyright (C) 2001-2007 OTRS GmbH, http://otrs.org/
# --
# $Id$
--- 1,5 ----
# --
# Kernel/System/Fred/DProf.pm
! # Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
# --
# $Id$
***************
*** 7,11 ****
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
! # did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --
--- 7,11 ----
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
! # did not receive this file, see http://www.gnu.org/licenses/gpl-2.0.txt.
# --
***************
*** 125,131 ****
# show the common performance results
my $ShownLines = $Config_Ref->{ShownLines} < 40 ? $Config_Ref->{ShownLines} : 40;
! my $Options = "-F -O $ShownLines";
! $Options .= $Config_Ref->{OrderBy} eq 'Name' ? ' -a'
! : $Config_Ref->{OrderBy} eq 'Calls' ? ' -l'
: '';
if (open my $Filehandle, "dprofpp $Options $Path/DProf.out |") {
--- 125,131 ----
# show the common performance results
my $ShownLines = $Config_Ref->{ShownLines} < 40 ? $Config_Ref->{ShownLines} : 40;
! my $Options = "-F -O $ShownLines ";
! $Options .= $Config_Ref->{OrderBy} eq 'Name' ? '-a'
! : $Config_Ref->{OrderBy} eq 'Calls' ? '-l'
: '';
if (open my $Filehandle, "dprofpp $Options $Path/DProf.out |") {
***************
*** 143,146 ****
--- 143,150 ----
shift @ProfilingResults;
+ if ($Config_Ref->{OrderBy} eq 'CuTime') {
+ @ProfilingResults = sort { $b->[2] <=> $a->[2] } @ProfilingResults;
+ }
+
# remove disabled packages if necessary
if ($Config_Ref->{DisabledPackages}) {
***************
*** 165,170 ****
--- 169,183 ----
}
+ # compute total calls
+ my $TotalCall = 0;
+ for my $Time (@ProfilingResults) {
+ if ($Time->[3] =~ /\d/) {
+ $TotalCall += $Time->[3];
+ }
+ }
+
$Param{ModuleRef}->{Data} = \@ProfilingResults;
$Param{ModuleRef}->{TotalTime} = $TotalTime;
+ $Param{ModuleRef}->{TotalCall} = $TotalCall;
return 1;
***************
*** 274,278 ****
This software comes with ABSOLUTELY NO WARRANTY. For details, see
the enclosed file COPYING for license information (GPL). If you
! did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
=cut
--- 287,291 ----
This software comes with ABSOLUTELY NO WARRANTY. For details, see
the enclosed file COPYING for license information (GPL). If you
! did not receive this file, see http://www.gnu.org/licenses/gpl-2.0.txt.
=cut
Author: tr
Index: SQLLog.pm
===================================================================
RCS file: /home/cvs/Fred/Kernel/System/Fred/SQLLog.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SQLLog.pm 18 Oct 2007 05:14:28 -0000 1.5
--- SQLLog.pm 2 Feb 2008 12:44:16 -0000 1.6
***************
*** 1,5 ****
# --
# Kernel/System/Fred/SQLLog.pm
! # Copyright (C) 2001-2007 OTRS GmbH, http://otrs.org/
# --
# $Id$
--- 1,5 ----
# --
# Kernel/System/Fred/SQLLog.pm
! # Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
# --
# $Id$
***************
*** 7,11 ****
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
! # did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --
--- 7,11 ----
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
! # did not receive this file, see http://www.gnu.org/licenses/gpl-2.0.txt.
# --
***************
*** 87,90 ****
--- 87,92 ----
my @LogMessages;
+ my $DoStatements = 0;
+ my $SelectStatements = 0;
# get the whole information
***************
*** 98,101 ****
--- 100,107 ----
}
push @LogMessages, \@SplitedLog;
+
+ if ($SplitedLog[0] eq 'SQL-DO') {
+ $DoStatements++;
+ }
}
***************
*** 103,108 ****
close $Filehandle;
$Self->InsertWord( What => "FRED\n" );
! $Param{ModuleRef}->{Data} = \@LogMessages;
return 1;
--- 109,126 ----
close $Filehandle;
+ # find multi used statements
+ my %MultiUsed;
+ for my $StatementRef (@LogMessages) {
+ $MultiUsed{$StatementRef->[1]}++;
+ }
+ for my $StatementRef (@LogMessages) {
+ push @{$StatementRef} , ($MultiUsed{$StatementRef->[1]} - 1);
+ }
+
$Self->InsertWord( What => "FRED\n" );
! $Param{ModuleRef}->{Data} = \@LogMessages;
! $Param{ModuleRef}->{AllStatements} = scalar @LogMessages;
! $Param{ModuleRef}->{DoStatements} = $DoStatements;
! $Param{ModuleRef}->{SelectStatements} = $Param{ModuleRef}->{AllStatements} - $DoStatements;
return 1;
***************
*** 140,144 ****
! \s*
\( \s*
! \$Self->{Curser} \s*
= \s*
\$Self->{dbh}->prepare\(\$SQL\) \s*
--- 158,162 ----
! \s*
\( \s*
! \$Self->{Curs(e|o)r} \s* # because of an typo bugfix in 2.3
= \s*
\$Self->{dbh}->prepare\(\$SQL\) \s*
***************
*** 258,262 ****
This software comes with ABSOLUTELY NO WARRANTY. For details, see
the enclosed file COPYING for license information (GPL). If you
! did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
=cut
--- 276,280 ----
This software comes with ABSOLUTELY NO WARRANTY. For details, see
the enclosed file COPYING for license information (GPL). If you
! did not receive this file, see http://www.gnu.org/licenses/gpl-2.0.txt.
=cut
Author: tr
Index: SmallProf.pm
===================================================================
RCS file: /home/cvs/Fred/Kernel/System/Fred/SmallProf.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** SmallProf.pm 30 Nov 2007 16:48:41 -0000 1.8
--- SmallProf.pm 2 Feb 2008 12:44:16 -0000 1.9
***************
*** 1,5 ****
# --
# Kernel/System/Fred/SmallProf.pm
! # Copyright (C) 2001-2007 OTRS GmbH, http://otrs.org/
# --
# $Id$
--- 1,5 ----
# --
# Kernel/System/Fred/SmallProf.pm
! # Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
# --
# $Id$
***************
*** 7,11 ****
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
! # did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --
--- 7,11 ----
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
! # did not receive this file, see http://www.gnu.org/licenses/gpl-2.0.txt.
# --
***************
*** 141,144 ****
--- 141,153 ----
}
+ # compute total calls
+ my $TotalCall = 0;
+ for my $Time (@Lines) {
+ if ($Time->[2] =~ /\d/) {
+ $TotalCall += $Time->[2];
+ }
+ }
+ $Param{ModuleRef}->{TotalCall} = $TotalCall;
+
return 1;
}
***************
*** 259,263 ****
This software comes with ABSOLUTELY NO WARRANTY. For details, see
the enclosed file COPYING for license information (GPL). If you
! did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
=cut
--- 268,272 ----
This software comes with ABSOLUTELY NO WARRANTY. For details, see
the enclosed file COPYING for license information (GPL). If you
! did not receive this file, see http://www.gnu.org/licenses/gpl-2.0.txt.
=cut
More information about the cvs-log
mailing list