1 ##########################################################################################
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
16 # The Original Code is mozilla.org code.
18 # The Initial Developer of the Original Code is
19 # Netscape Communications Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 1998
21 # the Initial Developer. All Rights Reserved.
26 # Alternatively, the contents of this file may be used under the terms of
27 # either the GNU General Public License Version 2 or later (the "GPL"), or
28 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 # in which case the provisions of the GPL or the LGPL are applicable instead
30 # of those above. If you wish to allow use of your version of this file only
31 # under the terms of either the GPL or the LGPL, and not to allow others to
32 # use your version of this file under the terms of the MPL, indicate your
33 # decision by deleting the provisions above and replace them with the notice
34 # and other provisions required by the GPL or the LGPL. If you do not delete
35 # the provisions above, a recipient may use your version of this file under
36 # the terms of any one of the MPL, the GPL or the LGPL.
38 # ***** END LICENSE BLOCK *****
40 #------------------------------------------------------------------------------
48 #------------------------------------------------------------------------------
50 #------------------------------------------------------------------------------
62 #------------------------------------------------------------------------------
63 # Open the history file and begin by collecting the records into the data-arrays
64 # and set all of the max-values too
65 #------------------------------------------------------------------------------
67 open( HISTORY
, "History.txt" ) or die "History file could not be opened\n";
80 # - percentage variables
91 @LineList = split( /,/, $ThisLine );
93 # get each value into a variable
94 $PullID = $LineList[$i++];
95 $RecordList[$count++] = $PullID;
96 debug_print
( "PullID : $PullID \n" );
97 $BuildID = $LineList[$i++];
98 $RecordList[$count++] = $BuildID;
99 debug_print
( "BuildID : $BuildID \n" );
101 $Parse_Time = $LineList[$i++];
102 $RecordList[$count++] = $Parse_Time;
103 debug_print
( "Parse_Time : $Parse_Time \n" );
104 $Parse_Per = $LineList[$i++];
105 $RecordList[$count++] = $Parse_Per;
106 debug_print
( "Parse_Per : $Parse_Per \n" );
107 $Content_Time = $LineList[$i++];
108 $RecordList[$count++] = $Content_Time;
109 debug_print
( "Content_Time : $Content_Time \n" );
110 $Content_Per = $LineList[$i++];
111 $RecordList[$count++] = $Content_Per;
112 debug_print
( "Content_Per : $Content_Per \n" );
113 $Frame_Time = $LineList[$i++];
114 $RecordList[$count++] = $Frame_Time;
115 debug_print
( "Frame_Time : $Frame_Time \n" );
116 $Frame_Per = $LineList[$i++];
117 $RecordList[$count++] = $Frame_Per;
118 debug_print
( "Frame_Per : $Frame_Per \n" );
119 $Style_Time = $LineList[$i++];
120 $RecordList[$count++] = $Style_Time;
121 debug_print
( "Style_Time : $Style_Time \n" );
122 $Style_Per = $LineList[$i++];
123 $RecordList[$count++] = $Style_Per;
124 debug_print
( "Style_Per : $Style_Per \n" );
125 $Reflow_Time = $LineList[$i++];
126 $RecordList[$count++] = $Reflow_Time;
127 debug_print
( "Reflow_Time : $Reflow_Time \n" );
128 $Reflow_Per = $LineList[$i++];
129 $RecordList[$count++] = $Reflow_Per;
130 debug_print
( "Reflow_Per : $Reflow_Per \n" );
131 $Layout_Time = $LineList[$i++];
132 $RecordList[$count++] = $Layout_Time;
133 debug_print
( "Layout_Time : $Layout_Time \n" );
134 $Layout_Per = $LineList[$i++];
135 $RecordList[$count++] = $Layout_Per;
136 debug_print
( "Layout_Per : $Layout_Per \n" );
137 $Total_Time = $LineList[$i++];
138 $RecordList[$count++] = $Total_Time;
139 debug_print
( "Total_Time : $Total_Time \n" );
141 # Now check for max values
142 if( $Parse_Time > $Parse_Time_Max ){
143 $Parse_Time_Max = $Parse_Time;
144 debug_print
( "ParseTimeMax: .$Parse_Time_Max\n");
146 if( $Content_Time > $Content_Time_Max ){
147 $Content_Time_Max = $Content_Time;
148 debug_print
( "Content_Time_Max: $Content_Time_Max\n");
150 if( $Frame_Time > $Frame_Time_Max ){
151 $Frame_Time_Max = $Frame_Time;
152 debug_print
( "Frame_Time_Max: $Frame_Time_Max\n");
154 if( $Style_Time > $Style_Time_Max ){
155 $Style_Time_Max = $Style_Time;
156 debug_print
( "Style_Time_Max: $Style_Time_Max\n");
158 if( $Reflow_Time > $Reflow_Time_Max ){
159 $Reflow_Time_Max = $Reflow_Time;
160 debug_print
( "Reflow_Time_Max: $Reflow_Time_Max\n");
162 if( $Layout_Time > $Layout_Time_Max ){
163 $Layout_Time_Max = $Layout_Time;
164 debug_print
( "Layout_Time_Max: $Layout_Time_Max\n");
167 if( $Total_Time > $Total_Time_Max ){
168 $Total_Time_Max = $Total_Time;
169 debug_print
( "Total_Time_Max: $Total_Time_Max\n");
174 for $foo (@RecordList){
175 # print( "FOO: $foo \n" );
178 for($index=0; $index<($count/15); $index++)
180 my $start = 15*$index;
182 print( "Start: $start -> End: $end\n");
183 my @entry = @RecordList[$start..$end];
184 print( "Processing entry $index\n");
185 ProcessEntry
( @entry );
189 #------------------------------------------------------------------------------
192 debug_print
("ProcessHeader\n");
194 ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime;
207 open(TRENDTABLE
, "> TrendTable.html") or die "Cannot open trend-table file (TrendTable.html) in ProcessHeader\n";
208 print(TRENDTABLE
"<!-- Generated by history.pl part of the Gecko PerfTools -->\n");
209 print(TRENDTABLE
"<BODY>\n" );
210 print(TRENDTABLE
"<H2 align=center><font color='maroon'>Performance History and Trending Table</font></H2><BR>\n" );
211 print (TRENDTABLE
"<center><font size=-1>");
212 print (TRENDTABLE
"$weekday{$wday} ");
213 print (TRENDTABLE
"$mon/$mday/$year ");
214 printf (TRENDTABLE
"%02d:%02d:%02d", $hour, $min, $sec);
215 print (TRENDTABLE
"</font></center>");
216 print (TRENDTABLE
"<BR>");
217 print(TRENDTABLE
"<!-- First the headings (static) -->\n" );
218 print(TRENDTABLE
"<TABLE BORDER=1 width=99% BGCOLOR='white'>\n" );
219 print(TRENDTABLE
"<TR >\n" );
220 print(TRENDTABLE
"<TD ROWSPAN=2 width=5% align=center valign=top BGCOLOR='#E0E0E0'>\n" );
221 print(TRENDTABLE
"<B>Pull-ID</B>\n" );
222 print(TRENDTABLE
"</TD>\n" );
223 print(TRENDTABLE
"<TD ROWSPAN=2 align=center width=5% valign=top BGCOLOR='#E0E0E0'>\n" );
224 print(TRENDTABLE
"<B>Build-ID</B>\n" );
225 print(TRENDTABLE
"</TD>\n" );
226 print(TRENDTABLE
"<TD ROWSPAN=1 align=center width=10% valign=top BGCOLOR='#E0E0E0'>\n" );
227 print(TRENDTABLE
"<B>Parsing</B>\n" );
228 print(TRENDTABLE
"</TD>\n" );
229 print(TRENDTABLE
"<TD ROWSPAN=1 align=center width=10% valign=top BGCOLOR='#E0E0E0'>\n" );
230 print(TRENDTABLE
"<B>Content Creation</B>\n" );
231 print(TRENDTABLE
"</TD>\n" );
232 print(TRENDTABLE
"<TD ROWSPAN=1 align=center width=10% valign=top BGCOLOR='#E0E0E0'>\n" );
233 print(TRENDTABLE
"<B>Frame Creation</B>\n" );
234 print(TRENDTABLE
"</TD>\n" );
235 print(TRENDTABLE
"<TD ROWSPAN=1 align=center width=10% valign=top BGCOLOR='#E0E0E0'>\n" );
236 print(TRENDTABLE
"<B>Style Resolution</B>\n" );
237 print(TRENDTABLE
"</TD>\n" );
238 print(TRENDTABLE
"<TD ROWSPAN=1 align=center width=10% valign=top BGCOLOR='#E0E0E0'>\n" );
239 print(TRENDTABLE
"<B>Reflow</B>\n" );
240 print(TRENDTABLE
"</TD>\n" );
241 print(TRENDTABLE
"<TD ROWSPAN=1 align=center width=10% valign=top BGCOLOR='#E0E0E0'>\n" );
242 print(TRENDTABLE
"<B>Total Layout</B>\n" );
243 print(TRENDTABLE
"<TD ROWSPAN=1 align=center width=10% valign=top BGCOLOR='#E0E0E0'>\n" );
244 print(TRENDTABLE
"<B>Total Time</B>\n" );
245 print(TRENDTABLE
"</TD>\n" );
246 print(TRENDTABLE
"</TR>\n" );
247 print(TRENDTABLE
"<TD>\n" );
248 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center BGCOLOR='#E0E0E0'>\n" );
249 print(TRENDTABLE
"<TR><TD BGCOLOR='#FFFFC6' align=left width=50%>Sec</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>%</TD></TR></TABLE>\n" );
250 print(TRENDTABLE
"</TD>\n" );
251 print(TRENDTABLE
"<TD>\n" );
252 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center BGCOLOR='#E0E0E0'>\n" );
253 print(TRENDTABLE
"<TR><TD BGCOLOR='#FFFFC6' align=left width=50%>Sec</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>%</TD></TR></TABLE>\n" );
254 print(TRENDTABLE
"</TD>\n" );
255 print(TRENDTABLE
"<TD>\n" );
256 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center BGCOLOR='#E0E0E0'>\n" );
257 print(TRENDTABLE
"<TR><TD BGCOLOR='#FFFFC6' align=left width=50%>Sec</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>%</TD></TR></TABLE>\n" );
258 print(TRENDTABLE
"</TD>\n" );
259 print(TRENDTABLE
"<TD>\n" );
260 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center BGCOLOR='#E0E0E0'>\n" );
261 print(TRENDTABLE
"<TR><TD BGCOLOR='#FFFFC6' align=left width=50%>Sec</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>%</TD></TR></TABLE>\n" );
262 print(TRENDTABLE
"</TD>\n" );
263 print(TRENDTABLE
"<TD>\n" );
264 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center BGCOLOR='#E0E0E0'>\n" );
265 print(TRENDTABLE
"<TR><TD BGCOLOR='#FFFFC6' align=left width=50%>Sec</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>%</TD></TR></TABLE>\n" );
266 print(TRENDTABLE
"</TD>\n" );
267 print(TRENDTABLE
"<TD>\n" );
268 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center BGCOLOR='#E0E0E0'>\n" );
269 print(TRENDTABLE
"<TR><TD BGCOLOR='#FFFFC6' align=left width=50%>Sec</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>%</TD></TR></TABLE>\n" );
270 print(TRENDTABLE
"</TD>\n" );
271 print(TRENDTABLE
"<TD>\n" );
272 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center BGCOLOR='#E0E0E0'>\n" );
273 print(TRENDTABLE
"<TR><TD BGCOLOR='#FFFFC6' align=left width=100%>Sec</TD></TR></TABLE>\n" );
274 print(TRENDTABLE
"</TD>\n" );
278 #------------------------------------------------------------------------------
292 # - percentage variables
301 my $Content_Weight=0;
308 debug_print
( "Process Entry\n" );
311 open(TRENDTABLE
, ">> TrendTable.html") or die "Cannot open trend-table file (TrendTable.html) in ProcessHeader\n";
313 $PullID = $EntryLine[$i++];
314 debug_print
( "PullID: $PullID \n" );
315 $BuildID = $EntryLine[$i++];
316 debug_print
( "BuildID: $BuildID \n" );
317 $Parse_Time = $EntryLine[$i++];
318 debug_print
( "Parse_Time : $Parse_Time \n" );
319 $Parse_Per = $EntryLine[$i++];
320 debug_print
( "Parse_Per : $Parse_Per \n" );
321 $Content_Time = $EntryLine[$i++];
322 debug_print
( "Content_Time : $Content_Time \n" );
323 $Content_Per = $EntryLine[$i++];
324 debug_print
( "Content_Per : $Content_Per \n" );
325 $Frame_Time = $EntryLine[$i++];
326 debug_print
( "Frame_Time : $Frame_Time \n" );
327 $Frame_Per = $EntryLine[$i++];
328 debug_print
( "Frame_Per : $Frame_Per \n" );
329 $Style_Time = $EntryLine[$i++];
330 debug_print
( "Style_Time : $Style_Time \n" );
331 $Style_Per = $EntryLine[$i++];
332 debug_print
( "Style_Per : $Style_Per \n" );
333 $Reflow_Time = $EntryLine[$i++];
334 debug_print
( "Reflow_Time : $Reflow_Time \n" );
335 $Reflow_Per = $EntryLine[$i++];
336 debug_print
( "Reflow_Per : $Reflow_Per \n" );
337 $Layout_Time = $EntryLine[$i++];
338 debug_print
( "Layout_Time : $Layout_Time \n" );
339 $Layout_Per = $EntryLine[$i++];
340 debug_print
( "Layout_Per : $Layout_Per \n" );
341 $Total_Time = $EntryLine[$i++];
342 debug_print
( "Total_Time : $Total_Time \n" );
344 if( $Parse_Time_Max > 0 ){
345 $ParseWeight = $Parse_Time / $Parse_Time_Max * 100;
346 debug_print
( "ParseWeight = $ParseWeight \n" );
348 if( $Content_Time_Max > 0 ){
349 $ContentWeight = $Content_Time / $Content_Time_Max * 100;
350 debug_print
( "ContentWeight = $ContentWeight \n" );
352 if( $Frame_Time_Max > 0 ){
353 $FrameWeight = $Frame_Time / $Frame_Time_Max * 100;
354 debug_print
( "FrameWeight = $FrameWeight \n" );
356 if( $Style_Time_Max > 0 ){
357 $StyleWeight = $Style_Time / $Style_Time_Max * 100;
358 debug_print
( "StyleWeight = $StyleWeight \n" );
360 if( $Reflow_Time_Max > 0 ){
361 $ReflowWeight = $Reflow_Time / $Reflow_Time_Max * 100;
362 debug_print
( "ReflowWeight = $ReflowWeight \n" );
364 if( $Layout_Time_Max > 0 ){
365 $LayoutWeight = $Layout_Time / $Layout_Time_Max * 100;
366 debug_print
( "LayoutWeight = $LayoutWeight \n" );
368 if( $Total_Time_Max > 0 ){
369 $TotalWeight = $Total_Time / $Total_Time_Max * 100;
370 debug_print
( "TotalWeight = $TotalWeight \n" );
374 @bldIDParts = split( /:/, $BuildID );
375 $bldID = $bldIDParts[1];
376 print(TRENDTABLE
"<!-- Next entry... -->\n");
377 print(TRENDTABLE
"<TR> \n");
378 print(TRENDTABLE
"<TD ROWSPAN=1>$PullID</TD>\n");
379 print(TRENDTABLE
"<TD ROWSPAN=1>$bldID</TD>\n");
380 print(TRENDTABLE
"<!-- Parse Time -->\n");
381 print(TRENDTABLE
"<TD>\n");
382 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center COLS=2><TR><TD BGCOLOR='#FFFFC6' align=left width=50%>");
383 printf(TRENDTABLE
"%4.3f", $Parse_Time);
384 print(TRENDTABLE
"</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>");
385 printf(TRENDTABLE
"%4.3f",$Parse_Per);
386 print(TRENDTABLE
"</TD></TR><TR><TD colspan=2><table WIDTH=$ParseWeight% bgcolor=blue><tr><td><font align=center size=-2> ");
387 print(TRENDTABLE
"</td></font></tr></table></TD></TR></TABLE>");
388 printf(TRENDTABLE
"<font size=-1>%4.2f % </font>", $ParseWeight);
389 print(TRENDTABLE
"</TD>\n");
390 print(TRENDTABLE
"<!-- Content Time -->\n");
391 print(TRENDTABLE
"<TD>\n");
392 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center COLS=2><TR><TD BGCOLOR='#FFFFC6' align=left width=50%>");
393 printf(TRENDTABLE
"%4.3f",$Content_Time);
394 print(TRENDTABLE
"</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>");
395 printf(TRENDTABLE
"%4.3f",$Content_Per);
396 print(TRENDTABLE
"</TD></TR><TR><TD colspan=2><table WIDTH=$ContentWeight% bgcolor=blue><tr><td><font align=center size=-2> ");
397 print(TRENDTABLE
"</td></font></tr></table></TD></TR></TABLE>");
398 printf(TRENDTABLE
"<font size=-1>%4.2f % </font>", $ContentWeight);
399 print(TRENDTABLE
"</TD>\n");
400 print(TRENDTABLE
"<!-- Frames Time -->\n");
401 print(TRENDTABLE
"<TD>\n");
402 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center COLS=2><TR><TD BGCOLOR='#FFFFC6' align=left width=50%>");
403 printf(TRENDTABLE
"%4.3f",$Frame_Time);
404 print(TRENDTABLE
"</TD><TD BGCOLOR='#CFEEF7' align=right width=50%> ");
405 printf(TRENDTABLE
"%4.3f",$Frame_Per);
406 print(TRENDTABLE
"</TD></TR><TR><TD colspan=2><table WIDTH=$FrameWeight% bgcolor=blue><tr><td><font align=center size=-2> ");
407 print(TRENDTABLE
"</td></font></tr></table></TD></TR></TABLE>");
408 printf(TRENDTABLE
"<font size=-1>%4.2f % </font>", $FrameWeight);
409 print(TRENDTABLE
"</TD>\n");
410 print(TRENDTABLE
"<!-- Style Time -->\n");
411 print(TRENDTABLE
"<TD>\n");
412 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center COLS=2><TR><TD BGCOLOR='#FFFFC6' align=left width=50%>");
413 printf(TRENDTABLE
"%4.3f",$Style_Time);
414 print(TRENDTABLE
"</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>");
415 printf(TRENDTABLE
"%4.3f",$Style_Per);
416 print(TRENDTABLE
"</TD></TR><TR><TD colspan=2><table WIDTH=$StyleWeight% bgcolor=blue><tr><td><font align=center size=-2> ");
417 print(TRENDTABLE
"</td></font></tr></table></TD></TR></TABLE>");
418 printf(TRENDTABLE
"<font size=-1>%4.2f % </font>", $StyleWeight);
419 print(TRENDTABLE
"</TD>\n");
420 print(TRENDTABLE
"<!-- Reflow Time -->\n");
421 print(TRENDTABLE
"<TD>\n");
422 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center COLS=2><TR><TD BGCOLOR='#FFFFC6' align=left width=50%>");
423 printf(TRENDTABLE
"%4.3f",$Reflow_Time);
424 print(TRENDTABLE
"</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>");
425 printf(TRENDTABLE
"%4.3f",$Reflow_Per);
426 print(TRENDTABLE
"</TD></TR><TR><TD colspan=2><table WIDTH=$ReflowWeight% bgcolor=blue><tr><td><font align=center size=-2> ");
427 print(TRENDTABLE
"</td></font></tr></table></TD></TR></TABLE>");
428 printf(TRENDTABLE
"<font size=-1>%4.2f % </font>", $ReflowWeight);
429 print(TRENDTABLE
"</TD>\n");
430 print(TRENDTABLE
"<!-- Layout Time -->\n");
431 print(TRENDTABLE
"<TD>\n");
432 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center COLS=2><TR><TD BGCOLOR='#FFFFC6' align=left width=50%>");
433 printf(TRENDTABLE
"%4.3f",$Layout_Time);
434 print(TRENDTABLE
"</TD><TD BGCOLOR='#CFEEF7' align=right width=50%>");
435 printf(TRENDTABLE
"%4.3f",$Layout_Per);
436 print(TRENDTABLE
"</TD></TR><TR><TD colspan=2><table WIDTH=$LayoutWeight% bgcolor=blue><tr><td><font align=center size=-2> ");
437 print(TRENDTABLE
"</td></font></tr></table></TD></TR></TABLE>");
438 printf(TRENDTABLE
"<font size=-1>%4.2f % </font>", $LayoutWeight);
439 print(TRENDTABLE
"</TD>\n");
440 print(TRENDTABLE
"<!-- Parse Time -->\n");
441 print(TRENDTABLE
"<TD>\n");
442 print(TRENDTABLE
"<TABLE BORDER=0 width=100% align=center COLS=2><TR><TD BGCOLOR='#FFFFC6' align=left width=100%>");
443 printf(TRENDTABLE
"%4.3f",$Total_Time);
444 print(TRENDTABLE
"</TD></TR><TR><TD colspan=2><table WIDTH=$TotalWeight% bgcolor=blue><tr><td><font align=center size=-2> ");
445 print(TRENDTABLE
"</td></font></tr></table></TD></TR></TABLE>");
446 printf(TRENDTABLE
"<font size=-1>%4.2f % </font>", $TotalWeight);
447 print(TRENDTABLE
"</TD>\n");
448 print(TRENDTABLE
"</TR>\n");
453 #------------------------------------------------------------------------------
456 debug_print
("ProcessHeader\n");
457 open(TRENDTABLE
, ">> TrendTable.html") or die "Cannot open trend-table file (TrendTable.html) in ProcessFooter\n";
459 print(TRENDTABLE
"</TABLE>\n");
460 print(TRENDTABLE
"</BODY>\n");