10/22/2008 00:22:01 Start testing --- File: Open Mode: Single User, RPVersion: 2
10/22/2008 00:22:01 Start ------- 1:1:11002_CustomerAdd_WithNotes_Rq.xml
10/22/2008 00:22:04 New QBXMLRP 0.328 65.03 0.00 0.00
10/22/2008 00:22:06 OpenConnection 1.031 65.03 0.00 0.00
10/22/2008 00:22:08 BeginSession 0.453 65.03 0.00 0.00
10/22/2008 00:22:14 ProcessRequest 4.984 65.46 0.43 0.83
10/22/2008 00:22:15 EndSession 0.016 65.46 0.00 0.00
10/22/2008 00:22:15 End --------- 1:1:11002_CustomerAdd_WithNotes_Rq.xml
10/22/2008 00:22:15 Start ------- 1:1:11004_AccountAdd_1_Rq.xml
10/22/2008 00:22:16 BeginSession 0.031 65.46 0.00 0.00
10/22/2008 00:22:17 ProcessRequest 0.422 65.57 0.10 0.59
10/22/2008 00:22:18 EndSession 0.000 65.57 0.00 0.00
10/22/2008 00:22:18 End --------- 1:1:11004_AccountAdd_1_Rq.xml
10/22/2008 00:22:18 Start ------- 1:1:11007_EmployeeAdd_Rq.xml
10/22/2008 00:22:20 BeginSession 0.094 65.57 0.00 0.00
10/22/2008 00:22:21 ProcessRequest 0.766 65.55 -0.02 0.88
10/22/2008 00:22:22 EndSession 0.016 65.55 0.00 0.00
10/22/2008 00:22:22 End --------- 1:1:11007_EmployeeAdd_Rq.xml
####
while () {
chomp($_);
# Look for title line
if ($_ =~/Start -/) {
my @sdk_line = split(/\t/, $_);
push(@temp, substr($sdk_line[1], 18));
}
}
####
while ()
{
chomp($_);
# find process time for that title
if ($_ =~/Process/) {
print split(/\t/, $_), "\n";
my @sdk_line = split(/\t/, $_);
push(@temp , $sdk_line[2]);
}
}
####
Request Name SU1 SU2 SU3 SU-Avg MU1 MU2 MU3 MU-Avg
11002_CustomerAdd_WithNotes_Rq.xml 4.984 6.766 6.766 2.645 2.141 6.125 6.766 3.006
11004_AccountAdd_1_Rq.xml 0.422 1.203 1.203 0.404 0.297 1.062 1.203 0.512
11007_EmployeeAdd_Rq.xml 0.766 0.359 0.359 0.212 0.250 0.281 0.359 0.178
####
## Get the XML names ##
sub GetXMLNames
{
open(INPUT, $inputPath);
my @temp_xml = ();
while () {
chomp($_);
# Look for title line
if ($_ =~/Start -/) {
my @sdk_line = split(/\t/, $_);
push(@temp, substr($sdk_line[1], 18));
}
}
close INPUT;
return @temp;
}
## Get the Process time ##
sub GetOnlyProcessTime{
open(LOG,">>$parseSDKPerfResultsLog");
open(INPUT, $inputPath);
my @temp =();
while ()
{
chomp($_);
# find process time for that title
if ($_ =~/Process/) {
my @sdk_line = split(/\t/, $_);
push(@temp , $sdk_line[2]);
}
}
my $number = scalar(@temp);
if($number < $Total_number_of_requests){
my $missing = $Total_number_of_requests - $number;
print LOG "$missing request(s) in $inputPath have not got executed. Hence exiting.\n";
close LOG;
close INPUT;
exit;
}
close INPUT;
return @temp;
}
## Parse all the logs ##
sub parseSDKPerfmonLogs{
open(LOG,">>$parseSDKPerfResultsLog");
for( my $su=1; $su <= $su_files; $su++){
$su_inputfile = "su".$su."_sdkperfmonlog.txt";
push(@su_inputfile,$su_inputfile);
}
for( my $mu=1; $mu <= $mu_files; $mu++){
$mu_inputfile = "mu".$mu."_sdkperfmonlog.txt";
push(@mu_inputfile,$mu_inputfile);
}
#############Get the Request file names in the first column #############
$inputPath=$ResFolderPath."\\su".$su_files."_sdkperfmonlog.txt";
@xml_names = GetXMLNames($inputPath);
$Total_number_of_requests = @xml_names;
############# end of Get the request names in results file ##########################
#############Get the SU process time #############
foreach $sufile (@su_inputfile){
#print $sufile;
$inputPath=$ResFolderPath."\\".$sufile;
$filenumber = substr($sufile,2,1);
@temp = GetOnlyProcessTime($inputPath);
if($filenumber <= $su_files){
if( $filenumber == 1){@su_first = @temp; }
elsif($filenumber == 2){@su_second = @temp; }
elsif($filenumber == 3){@su_third = @temp; }
}
}
#############End of Get the SU process time #############
#############Get the MU process time #############
foreach $mufile (@mu_inputfile){
#print $sufile;
$inputPath=$ResFolderPath."\\".$mufile;
$filenumber = substr($mufile,2,1);
@temp = GetOnlyProcessTime($inputPath);
if($filenumber <= $mu_files){
if( $filenumber == 1){@mu_first = @temp; }
elsif($filenumber == 2){@mu_second = @temp; }
elsif($filenumber == 3){@mu_third = @temp; }
}
}
#############End of Get the MU process time #############
#############Write everything to the output file #############
open(OUTPUT, ">>$outputFile") ;
for(my $i = 0; $i < $Total_number_of_requests; $i++){
my $su_average = sprintf("%.3f", (($su_first[$i] + $su_second[$i] + $su_third[$i])/$su_files));
my $mu_average = sprintf("%.3f",(($mu_first[$i] + $mu_second[$i] + $mu_third[$i])/$mu_files));
print(OUTPUT "$xml_names[$i]\t$su_first[$i]\t$su_second[$i]\t$su_third[$i]\t$su_average\t$mu_first[$i]\t$mu_second[$i]\t$mu_third[$i]\t$mu_average \n");
}
print LOG "All the values from performance logs are available in $outputFile \n ";
close OUTPUT;
#############End of Write everything to the output file #############
}