diff options
author | cmp@google.com <cmp@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 00:12:53 +0000 |
---|---|---|
committer | cmp@google.com <cmp@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 00:12:53 +0000 |
commit | 58734d6a4fb8aa8caaece4b07f875c5c396afcc5 (patch) | |
tree | 0c8cd711c1a4c3cc6818869cebfb656ae971d1b0 /tools/page_cycler/common/report.html | |
parent | 3cfe049042544b4e8db7e7119e8099ba555258aa (diff) | |
download | chromium_src-58734d6a4fb8aa8caaece4b07f875c5c396afcc5.zip chromium_src-58734d6a4fb8aa8caaece4b07f875c5c396afcc5.tar.gz chromium_src-58734d6a4fb8aa8caaece4b07f875c5c396afcc5.tar.bz2 |
Add common page_cycler and checkout acid3 cycler.
These common files are used by page cyclers to provide a
standard JS test harness and report base.
Add acid3 page cycler to chromium checkout.
Review URL: http://codereview.chromium.org/151053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19564 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/page_cycler/common/report.html')
-rw-r--r-- | tools/page_cycler/common/report.html | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/tools/page_cycler/common/report.html b/tools/page_cycler/common/report.html new file mode 100644 index 0000000..221d8ab --- /dev/null +++ b/tools/page_cycler/common/report.html @@ -0,0 +1,173 @@ +<html> +<head> +<style> +.discarded { + color: #C0C0C0; +} +</style> +<h2>Summary</h2> +<dl> +<script src="head.js"></script> +<script> +var __results = true; +var cycles = 0; +var s = document.location.search.substring(1); +var params = s.split('&'); +var iterations, pages, totalTime, fudgeTime; +for (var i = 0; i < params.length; ++i) { + var f = params[i].split('='); + switch (f[0]) { + case 'n': + iterations = (f[1] - 0); + break; + case 'i': + cycle = (f[1] - 0); + break; + case 'td': + totalTime = (f[1] - 0); + break; + case 'tf': + fudgeTime = (f[1] - 0); + break; + } +} +var pages = cycle / iterations; +document.write("<table border=1>"); +document.write("<tr><td>iterations</td><td>" + iterations + "</td></tr>"); +document.write("<tr><td>pages</td><td>" + pages + "</td></tr>"); +document.write("<tr><td>milliseconds</td><td>" + totalTime + "</td></tr>"); +document.write("<tr><td>mean per set</td><td>" + (totalTime / iterations).toFixed(2) + "</td></tr>"); +document.write("<tr><td>mean per page</td><td>" + (totalTime / iterations / pages).toFixed(2) + "</td></tr>"); +document.write("<tr><td>timer lag</td><td>" + (fudgeTime).toFixed(2) + "</td></tr>"); +document.write("<tr><td>timer lag per page</td><td>" + (fudgeTime / iterations / pages).toFixed(2) + "</td></tr>"); +document.write("</table>"); + + // returns an object with the following properties: + // min : min value of array elements + // max : max value of array elements + // mean : mean value of array elements + // vari : variance computation + // stdd : standard deviation, sqrt(vari) + // indexOfMax : index of max element (the element that is + // removed from the mean computation) + function getArrayStats(ary) { + var r = {}; + r.min = ary[0]; + r.max = ary[0]; + r.indexOfMax = 0; + var sum = 0; + for (var i = 0; i < ary.length; ++i) { + if (ary[i] < r.min) { + r.min = ary[i]; + } else if (ary[i] > r.max) { + r.max = ary[i]; + r.indexOfMax = i; + } + sum = sum + ary[i]; + } + + // ignore max value when computing mean and stddev + r.mean = (sum - r.max) / (ary.length - 1); + + r.vari = 0; + for (var i = 0; i < ary.length; ++i) { + if (i == r.indexOfMax) + continue; + var d = r.mean - ary[i]; + r.vari = r.vari + d * d; + } + + r.vari = r.vari / (ary.length - 1); + r.stdd = Math.sqrt(r.vari); + return r; + } + + function appendTableCol(tr, text, linkify) { + var doc = tr.ownerDocument; + var td = doc.createElement("TD"); + + if (linkify) { + var anchor = doc.createElement("A"); + anchor.href = text + "/index.html?skip=true"; + anchor.appendChild(doc.createTextNode(text)); + td.appendChild(anchor); + } + else + td.appendChild(doc.createTextNode(text)); + tr.appendChild(td); + return td; + } + + function getTimeVals() { + var rawData = __get_timings().split(","); + var timeVals = []; + for (var i = 0; i < iterations; ++i) { + for (var j = 0; j < pages; ++j) { + if (!timeVals[j]) + timeVals[j] = []; + timeVals[j].push(parseInt(rawData[j + i*pages])); + } + } + return timeVals; + } + + function showReport() { + var tbody = document.getElementById("tbody"); + var colsums = [0,0,0,0]; + var timeVals = getTimeVals(); + for (var i = 0; i < timeVals.length; ++i) { + var tr = document.createElement("TR"); + + appendTableCol(tr, __pages()[i], true); + + var r = getArrayStats(timeVals[i]); + appendTableCol(tr, r.min.toFixed(2)); + appendTableCol(tr, r.max.toFixed(2)); + appendTableCol(tr, r.mean.toFixed(2)); + appendTableCol(tr, r.stdd.toFixed(2)); + //appendTableCol(tr, r.chi2.toFixed(2)); + + for (var j = 0; j < timeVals[i].length; ++j) { + var tv = timeVals[i][j]; + var td = appendTableCol(tr, tv); + if (j == r.indexOfMax) + td.setAttribute("class", "discarded"); + } + + colsums[0] = colsums[0] + r.min; + colsums[1] = colsums[1] + r.max; + colsums[2] = colsums[2] + r.mean; + colsums[3] = colsums[3] + r.stdd; + + tbody.appendChild(tr); + } + + var tr = document.createElement("TR"); + appendTableCol(tr, "totals:"); + for (var k = 0; k < colsums.length; ++k) + appendTableCol(tr, colsums[k].toFixed(2)); + tbody.appendChild(tr); + } + window.onload = showReport; + +</script> +</dl> +</head> +<body> +<h2>Complete Statistics</h2> +<table border="1"> +<thead> +<tr> + <th>Site</th> + <th>Min</th> + <th>Max</th> + <th>Mean</th> + <th>Std.d</th> + <th colspan="10">Runs</th> +</tr> +</thead> +<tbody id="tbody"></tbody> +</table> +</body> +</html> + |