Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Side by Side Diff: tools/page_cycler/common/report.html

Issue 151053: Add common page_cycler and checkout acid3 cycler. (Closed)
Patch Set: remove README.chromium Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/page_cycler/common/head.js ('k') | tools/page_cycler/common/start.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <style>
4 .discarded {
5 color: #C0C0C0;
6 }
7 </style>
8 <h2>Summary</h2>
9 <dl>
10 <script src="head.js"></script>
11 <script>
12 var __results = true;
13 var cycles = 0;
14 var s = document.location.search.substring(1);
15 var params = s.split('&');
16 var iterations, pages, totalTime, fudgeTime;
17 for (var i = 0; i < params.length; ++i) {
18 var f = params[i].split('=');
19 switch (f[0]) {
20 case 'n':
21 iterations = (f[1] - 0);
22 break;
23 case 'i':
24 cycle = (f[1] - 0);
25 break;
26 case 'td':
27 totalTime = (f[1] - 0);
28 break;
29 case 'tf':
30 fudgeTime = (f[1] - 0);
31 break;
32 }
33 }
34 var pages = cycle / iterations;
35 document.write("<table border=1>");
36 document.write("<tr><td>iterations</td><td>" + iterations + "</td></tr>");
37 document.write("<tr><td>pages</td><td>" + pages + "</td></tr>");
38 document.write("<tr><td>milliseconds</td><td>" + totalTime + "</td></tr>");
39 document.write("<tr><td>mean per set</td><td>" + (totalTime / iterations).toFixe d(2) + "</td></tr>");
40 document.write("<tr><td>mean per page</td><td>" + (totalTime / iterations / page s).toFixed(2) + "</td></tr>");
41 document.write("<tr><td>timer lag</td><td>" + (fudgeTime).toFixed(2) + "</td></t r>");
42 document.write("<tr><td>timer lag per page</td><td>" + (fudgeTime / iterations / pages).toFixed(2) + "</td></tr>");
43 document.write("</table>");
44
45 // returns an object with the following properties:
46 // min : min value of array elements
47 // max : max value of array elements
48 // mean : mean value of array elements
49 // vari : variance computation
50 // stdd : standard deviation, sqrt(vari)
51 // indexOfMax : index of max element (the element that is
52 // removed from the mean computation)
53 function getArrayStats(ary) {
54 var r = {};
55 r.min = ary[0];
56 r.max = ary[0];
57 r.indexOfMax = 0;
58 var sum = 0;
59 for (var i = 0; i < ary.length; ++i) {
60 if (ary[i] < r.min) {
61 r.min = ary[i];
62 } else if (ary[i] > r.max) {
63 r.max = ary[i];
64 r.indexOfMax = i;
65 }
66 sum = sum + ary[i];
67 }
68
69 // ignore max value when computing mean and stddev
70 r.mean = (sum - r.max) / (ary.length - 1);
71
72 r.vari = 0;
73 for (var i = 0; i < ary.length; ++i) {
74 if (i == r.indexOfMax)
75 continue;
76 var d = r.mean - ary[i];
77 r.vari = r.vari + d * d;
78 }
79
80 r.vari = r.vari / (ary.length - 1);
81 r.stdd = Math.sqrt(r.vari);
82 return r;
83 }
84
85 function appendTableCol(tr, text, linkify) {
86 var doc = tr.ownerDocument;
87 var td = doc.createElement("TD");
88
89 if (linkify) {
90 var anchor = doc.createElement("A");
91 anchor.href = text + "/index.html?skip=true";
92 anchor.appendChild(doc.createTextNode(text));
93 td.appendChild(anchor);
94 }
95 else
96 td.appendChild(doc.createTextNode(text));
97 tr.appendChild(td);
98 return td;
99 }
100
101 function getTimeVals() {
102 var rawData = __get_timings().split(",");
103 var timeVals = [];
104 for (var i = 0; i < iterations; ++i) {
105 for (var j = 0; j < pages; ++j) {
106 if (!timeVals[j])
107 timeVals[j] = [];
108 timeVals[j].push(parseInt(rawData[j + i*pages]));
109 }
110 }
111 return timeVals;
112 }
113
114 function showReport() {
115 var tbody = document.getElementById("tbody");
116 var colsums = [0,0,0,0];
117 var timeVals = getTimeVals();
118 for (var i = 0; i < timeVals.length; ++i) {
119 var tr = document.createElement("TR");
120
121 appendTableCol(tr, __pages()[i], true);
122
123 var r = getArrayStats(timeVals[i]);
124 appendTableCol(tr, r.min.toFixed(2));
125 appendTableCol(tr, r.max.toFixed(2));
126 appendTableCol(tr, r.mean.toFixed(2));
127 appendTableCol(tr, r.stdd.toFixed(2));
128 //appendTableCol(tr, r.chi2.toFixed(2));
129
130 for (var j = 0; j < timeVals[i].length; ++j) {
131 var tv = timeVals[i][j];
132 var td = appendTableCol(tr, tv);
133 if (j == r.indexOfMax)
134 td.setAttribute("class", "discarded");
135 }
136
137 colsums[0] = colsums[0] + r.min;
138 colsums[1] = colsums[1] + r.max;
139 colsums[2] = colsums[2] + r.mean;
140 colsums[3] = colsums[3] + r.stdd;
141
142 tbody.appendChild(tr);
143 }
144
145 var tr = document.createElement("TR");
146 appendTableCol(tr, "totals:");
147 for (var k = 0; k < colsums.length; ++k)
148 appendTableCol(tr, colsums[k].toFixed(2));
149 tbody.appendChild(tr);
150 }
151 window.onload = showReport;
152
153 </script>
154 </dl>
155 </head>
156 <body>
157 <h2>Complete Statistics</h2>
158 <table border="1">
159 <thead>
160 <tr>
161 <th>Site</th>
162 <th>Min</th>
163 <th>Max</th>
164 <th>Mean</th>
165 <th>Std.d</th>
166 <th colspan="10">Runs</th>
167 </tr>
168 </thead>
169 <tbody id="tbody"></tbody>
170 </table>
171 </body>
172 </html>
173
OLDNEW
« no previous file with comments | « tools/page_cycler/common/head.js ('k') | tools/page_cycler/common/start.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698