3 # This file drives the Neck Page Load Timer.
4 # Written by John A. Taylor in 2001
14 my $file_name; # = "PageList_all_pages.txt";
15 my $output_file = "timing_output.html";
16 my $test_loc; # = " c:/builds/src/mozilla/dist/WIN32_O.OBJ/bin/TestPageLoad";
25 $num_tests = $ARGV[0];
26 $file_name = $ARGV[1];
29 push (@pageList, GetTestList
($file_name));
32 for($i = 0; $i < $num_tests; $i++) {
34 foreach $page (@pageList) {
35 my $start, $finish, $total;
36 $test_com = $test_loc . " " . $page . " | ";
37 printf "Testing (%d/%d): $page\n",$i*$num_pages+$j+1, $num_tests * $num_pages;
38 # $start = (times)[0];
39 open (TEST
, $test_com)
40 || die ("Could not find test program: $test_loc");
42 if(/>>PageLoadTime>>(\d*)>>/){
45 $timeList[$j][$i] = $this;
46 @avgTimes[$j] += $this;
47 if($this > @maxTimes[$j] || $i == 0) {
48 @maxTimes[$j] = $this;
50 if($this < @minTimes[$j] || $i == 0) {
51 @minTimes[$j] = $this;
59 for($i = 0; $i < $j; $i++) {
60 @avgTimes[$i] /= $num_tests;
64 print "\nHTML formated report is in: timing_output.html\nin this directory\n";
67 my $num_cols = $num_tests + 4;
70 open (OUT
, ">$output_file");
71 print OUT
"<HTML><BODY><H3>Necko Timing Test Results</H3>",
72 "<b>Number of iterations: $num_tests</b>",
73 "<TABLE border=1 cols=$num_cols><tr><td>Page Location</td><td>Avg Time</td>",
74 "<td>Max Time</td><td>Min Time</td><td colspan=$num_tests>Times ... </td>";
76 foreach $page(@pageList) {
78 #$max_time = @maxTimes[$j];
79 #$min_time = @minTimes[$j];
80 #$avg_time = @avgTimes[$j];
81 #$time_1 = $timeList[$j][0];
83 printf OUT
"<tr><td>$page</td><td>%d</td><td>@maxTimes[$j]</td><td>@minTimes[$j]</td>", @avgTimes[$j];
84 #print "\n$page\t\t@avgTimes[$j]\t@maxTimes[$j]\t@minTimes[$j]\t";
86 for($i=0; $i < $num_tests; $i++){
87 print OUT
"<td>$timeList[$j][$i]</td>";
92 print OUT
"</TABLE><H4><I>Report Done</I></H4></BODY></HTML>";
99 open (TESTLIST
, $list_file) ||
100 die("Could not find test list file: '$list_file': $!\n");
105 # It's not a comment, so process it
117 ("\nusage: $0 NUM FILE LOC \n\n" .
118 "NUM Number of iterations you want\n" .
119 "FILE Location of input file containing test pages\n" .
120 "LOC Path (including executable) of TestPageLoad\n" .
121 " (should be in same directory as mozilla bin\n".
122 " ex: /builds/mozilla/dist/bin/TestPageLoad )\n\n");