/tools/performance/layout/Header.pl

http://github.com/zpao/v8monkey · Perl · 183 lines · 111 code · 9 blank · 63 comment · 2 complexity · f69d3abc49989f3716046f3da6feaabd MD5 · raw file

  1. ##########################################################################################
  2. #
  3. # ***** BEGIN LICENSE BLOCK *****
  4. # Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5. #
  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/
  10. #
  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
  14. # License.
  15. #
  16. # The Original Code is mozilla.org code.
  17. #
  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.
  22. #
  23. # Contributor(s):
  24. # 2/10/00 attinasi
  25. #
  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.
  37. #
  38. # ***** END LICENSE BLOCK *****
  39. #############################################
  40. # User-defined variables
  41. #
  42. $machineStats = "WinNT 4.0 (sp5), 450 MHz, 128mg RAM";
  43. #
  44. #############################################
  45. sub debug_print {
  46. foreach $str (@_){
  47. # print( $str );
  48. }
  49. }
  50. @ARGV;
  51. #$buildRoot = $ARGV[0];
  52. #$buildIDFile = '< '.$buildRoot.'\bin\chrome\locales\en-US\navigator\locale\navigator.dtd';
  53. $pullDate = $ARGV[1];
  54. $useClockTime = $ARGV[2];
  55. #open (XUL_FILE, $buildIDFile) or die "Unable to open BuildID file $buildIDFile (header.pl)";
  56. #$BuildNo = "";
  57. #$LineList;
  58. #while (<XUL_FILE>)
  59. #{
  60. # $ThisLine = $_;
  61. # chop ($ThisLine);
  62. # if (/Build ID/){
  63. # @LineList = split (/\"/, $ThisLine);
  64. # $BuildNo = $LineList[1];
  65. # }
  66. #}
  67. #$BuildNo =~ s/"//g;
  68. #$BuildNo =~ s/[>]//g;
  69. #close (XUL_FILE);
  70. #debug_print ($BuildNo);
  71. #############################################
  72. ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime;
  73. %weekday= (
  74. "1", "$day",
  75. '2', 'Tuesday',
  76. '3', 'Wednesday',
  77. '4', 'Thursday',
  78. '5', 'Friday',
  79. '6', 'Saturday',
  80. '7', 'Sunday',
  81. );
  82. $mon += 1;
  83. $year += 1900;
  84. open (TABLE_FILE, ">table.html");
  85. print (TABLE_FILE "<center><b><font size=+2>Top 40 Sites - File Load Performance Metrics</font></b></center>");
  86. print (TABLE_FILE "<center><b><font size=+2>Seamonkey Win32</font></B></Center>");
  87. print (TABLE_FILE "<BR>");
  88. print (TABLE_FILE "<center><font size=+2 color=maroon>$pullDate</font></center>");
  89. print (TABLE_FILE "<BR><center><b><font size=+1>");
  90. print (TABLE_FILE "$weekday{$wday} ");
  91. print (TABLE_FILE "$mon/$mday/$year ");
  92. printf (TABLE_FILE "%02d:%02d:%02d", $hour, $min, $sec);
  93. print (TABLE_FILE "</font></b></center>");
  94. print (TABLE_FILE "<BR>");
  95. print (TABLE_FILE "<B><CENTER><font size=-1>\n");
  96. print (TABLE_FILE "$machineStats\n");
  97. print (TABLE_FILE "<BR>");
  98. if($useClockTime){
  99. print (TABLE_FILE "Time is reported in Seconds of Clock time");
  100. } else {
  101. print (TABLE_FILE "Time is reported in Seconds of CPU time");
  102. }
  103. print (TABLE_FILE "</font></CENTER></B>\n");
  104. print (TABLE_FILE "<BR>\n\n");
  105. print (TABLE_FILE "<table BORDER COLS=15 WIDTH='90%' BGCOLOR='#CCFFFF'>");
  106. print (TABLE_FILE "<tr>");
  107. print (TABLE_FILE "<td WIDTH='25%'></td>");
  108. print (TABLE_FILE "<td COLSPAN='2' BGCOLOR='#CCFFFF'>");
  109. print (TABLE_FILE "<center><b>Parsing</b></center>");
  110. print (TABLE_FILE "</td>");
  111. print (TABLE_FILE "<td COLSPAN='2' BGCOLOR='#CCFFFF'>");
  112. print (TABLE_FILE "<center><b>Content Creation</b></center>");
  113. print (TABLE_FILE "</td>");
  114. print (TABLE_FILE "<td COLSPAN='2' BGCOLOR='#CCFFFF'>");
  115. print (TABLE_FILE "<center><b>Frame Creation</b></center>");
  116. print (TABLE_FILE "</td>");
  117. print (TABLE_FILE "<td COLSPAN='2' BGCOLOR='#CCFFFF'>");
  118. print (TABLE_FILE "<center><b>Style Resolution</b></center>");
  119. print (TABLE_FILE "</td>");
  120. print (TABLE_FILE "<td COLSPAN='2' BGCOLOR='#CCFFFF'>");
  121. print (TABLE_FILE "<center><b>Reflow</b></center>");
  122. print (TABLE_FILE "</td>");
  123. print (TABLE_FILE "<td COLSPAN='2' BGCOLOR='#CCFFFF'>");
  124. print (TABLE_FILE "<center><b>Total Layout Time</b></center>");
  125. print (TABLE_FILE "</td>");
  126. print (TABLE_FILE "<td COLSPAN='2' BGCOLOR='#CCFFFF'>");
  127. print (TABLE_FILE "<center><b>Total Page Load Time</b></center>");
  128. print (TABLE_FILE "</td>");
  129. print (TABLE_FILE "</tr>");
  130. print (TABLE_FILE "<tr>");
  131. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  132. print (TABLE_FILE "<center><b>Sites</b></center>");
  133. print (TABLE_FILE "</td>");
  134. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  135. print (TABLE_FILE "<center><b>Time</b></center>");
  136. print (TABLE_FILE "</td>");
  137. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  138. print (TABLE_FILE "<center><b>%</b></center>");
  139. print (TABLE_FILE "</td>");
  140. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  141. print (TABLE_FILE "<center><b>Time</b></center>");
  142. print (TABLE_FILE "</td>");
  143. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  144. print (TABLE_FILE "<center><b>%</b></center>");
  145. print (TABLE_FILE "</td>");
  146. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  147. print (TABLE_FILE "<center><b>Time</b></center>");
  148. print (TABLE_FILE "</td>");
  149. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  150. print (TABLE_FILE "<center><b>%</b></center>");
  151. print (TABLE_FILE "</td>");
  152. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  153. print (TABLE_FILE "<center><b>Time</b></center>");
  154. print (TABLE_FILE "</td>");
  155. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  156. print (TABLE_FILE "<center><b>%</b></center>");
  157. print (TABLE_FILE "</td>");
  158. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  159. print (TABLE_FILE "<center><b>Time</b></center>");
  160. print (TABLE_FILE "</td>");
  161. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  162. print (TABLE_FILE "<center><b>%</b></center>");
  163. print (TABLE_FILE "</td>");
  164. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  165. print (TABLE_FILE "<center><b>Time</b></center>");
  166. print (TABLE_FILE "</td>");
  167. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  168. print (TABLE_FILE "<center><b>%</b></center>");
  169. print (TABLE_FILE "</td>");
  170. print (TABLE_FILE "<td COLSPAN='1' WIDTH='25%' BGCOLOR='#CCFFFF'>");
  171. print (TABLE_FILE "<center><b>Time</b></center>");
  172. print (TABLE_FILE "</td>");
  173. print (TABLE_FILE "</tr>\n\n");
  174. close (TABLE_FILE);