| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <style> | |
| 4 body { | |
| 5 font-family: sans-serif; | |
| 6 } | |
| 7 div#output { | |
| 8 cursor: pointer; | |
| 9 } | |
| 10 div#switcher { | |
| 11 cursor: pointer; | |
| 12 } | |
| 13 div#switcher a { | |
| 14 border-top: 1px solid black; | |
| 15 border-left: 1px solid black; | |
| 16 padding-left: 0.5em; | |
| 17 padding-right: 0.5em; | |
| 18 } | |
| 19 canvas.plot { | |
| 20 border: 1px solid black; | |
| 21 } | |
| 22 div.plot-coordinates { | |
| 23 font-family: monospace; | |
| 24 } | |
| 25 iframe { | |
| 26 display: none; | |
| 27 width: 100%; | |
| 28 height: 100%; | |
| 29 border: none; | |
| 30 } | |
| 31 div.selector { | |
| 32 border: solid 1px black; | |
| 33 cursor: pointer; | |
| 34 padding-left: 0.3em; | |
| 35 background-color: white; | |
| 36 } | |
| 37 div.selector:hover { | |
| 38 background-color: rgb(200,200,250); | |
| 39 } | |
| 40 div.selected { | |
| 41 border-left: none; | |
| 42 } | |
| 43 div#selectors { | |
| 44 width: 80px; | |
| 45 display: none; | |
| 46 } | |
| 47 </style> | |
| 48 <script src="js/common.js"></script> | |
| 49 <script src="js/coordinates.js"></script> | |
| 50 <script src="js/plotter.js"></script> | |
| 51 <script src="config.js"></script> | |
| 52 <script> | |
| 53 document.title = Config.title; | |
| 54 | |
| 55 var params = ParseParams(); | |
| 56 if (!('history' in params)) { | |
| 57 params.history = 150; | |
| 58 window.location.href = MakeURL(params); | |
| 59 } | |
| 60 if (!('trace' in params)) { | |
| 61 params.trace = 'summary'; | |
| 62 window.location.href = MakeURL(params); | |
| 63 } | |
| 64 | |
| 65 function goTo(trace) { | |
| 66 params.trace = trace; | |
| 67 if (params.trace == '' && params.trace != '0') | |
| 68 params.trace = 'summary'; | |
| 69 window.location.href = MakeURL(params); | |
| 70 } | |
| 71 | |
| 72 function goToClosure(trace) { | |
| 73 return function(){goTo(trace)}; | |
| 74 } | |
| 75 | |
| 76 var didUpdatePositionDetails = false; | |
| 77 | |
| 78 function unitsForTrace() { | |
| 79 return 'msec'; | |
| 80 } | |
| 81 | |
| 82 function timing(dict) { | |
| 83 return parseFloat(dict['time']); | |
| 84 } | |
| 85 | |
| 86 function deviation(absoluteValue, dict) { | |
| 87 deviationPercentage = parseFloat(dict['stdd']); | |
| 88 return absoluteValue / 100 * deviationPercentage; | |
| 89 } | |
| 90 | |
| 91 function testCategoryDetails(dict) { | |
| 92 return dict['details']; | |
| 93 } | |
| 94 | |
| 95 function jsonToJs(data) { | |
| 96 return eval('(' + data + ')') | |
| 97 } | |
| 98 | |
| 99 function addSelectionTabs(rows) { | |
| 100 if (rows.length > 0 && rows[0].length > 0) { | |
| 101 data = jsonToJs(rows[0]); | |
| 102 tabs = ['summary']; | |
| 103 for (var clNumber in data) | |
| 104 for (var testType in data[clNumber]) | |
| 105 for (test_name in testCategoryDetails(data[clNumber][testType])) | |
| 106 tabs.push(test_name); | |
| 107 | |
| 108 initPlotSwitcher(tabs); | |
| 109 } | |
| 110 } | |
| 111 | |
| 112 function onSummaryReceived(data) { | |
| 113 var rows = data.split('\n'); | |
| 114 addSelectionTabs(rows); | |
| 115 clNumbers = []; | |
| 116 dataRows = {}; | |
| 117 | |
| 118 for(var i = 0; i < rows.length; i++) { | |
| 119 if (rows[i].length < 1) | |
| 120 break; | |
| 121 if (i > params.history) // limit by history | |
| 122 break; | |
| 123 | |
| 124 clData = jsonToJs(rows[i]); | |
| 125 | |
| 126 if (params.trace == 'summary') { | |
| 127 for (var clNumber in clData) { | |
| 128 clNumbers.push(clNumber) | |
| 129 | |
| 130 for(testType in clData[clNumber]){ | |
| 131 if(!dataRows[testType]) | |
| 132 dataRows[testType] = [] | |
| 133 | |
| 134 time = timing(clData[clNumber][testType]); | |
| 135 stdd = deviation(time, clData[clNumber][testType]); | |
| 136 dataRows[testType].push([time, stdd]) | |
| 137 } | |
| 138 } | |
| 139 } else { | |
| 140 // specific selection that is defined in params.trace | |
| 141 for (var clNumber in clData) { | |
| 142 clNumbers.push(clNumber) | |
| 143 currentData = clData[clNumber] | |
| 144 for(testType in currentData){ | |
| 145 if(!dataRows[params.trace]) | |
| 146 dataRows[params.trace] = [] | |
| 147 | |
| 148 details = testCategoryDetails(currentData[testType]); | |
| 149 if (details[params.trace]) { | |
| 150 testData = details[params.trace]; | |
| 151 time = timing(testData); | |
| 152 stdd = deviation(time, testData); | |
| 153 dataRows[params.trace].push([time, stdd]) | |
| 154 break; | |
| 155 } | |
| 156 } | |
| 157 } | |
| 158 } | |
| 159 } | |
| 160 | |
| 161 dataGrid = [] | |
| 162 for(key in dataRows) { | |
| 163 dataGrid.push(dataRows[key].reverse()) | |
| 164 } | |
| 165 clNumbers.reverse(); | |
| 166 var plotter = new Plotter(clNumbers, dataGrid, Config.dataDescription, | |
| 167 unitsForTrace(), document.getElementById("output")); | |
| 168 plotter.onclick = handlePlotClicked; | |
| 169 plotter.plot(); | |
| 170 | |
| 171 return; | |
| 172 } | |
| 173 | |
| 174 function handlePlotClicked(cl, value, fuzz, e) { | |
| 175 document.getElementById('view-change'). | |
| 176 setAttribute('src', Config.changeLinkPrefix + cl); | |
| 177 | |
| 178 if (!didUpdatePositionDetails) { | |
| 179 updatePositionDetails(); | |
| 180 didUpdatePositionDetails = true; | |
| 181 } | |
| 182 } | |
| 183 | |
| 184 function updatePositionDetails() { | |
| 185 var output = document.getElementById("output"); | |
| 186 var win_height = window.innerHeight; | |
| 187 var details = document.getElementById("views"); | |
| 188 var views = document.getElementById("views"); | |
| 189 var selectors = document.getElementById("selectors"); | |
| 190 selectors.style.display = "block"; | |
| 191 | |
| 192 var views_width = output.offsetWidth - selectors.offsetWidth; | |
| 193 | |
| 194 views.style.border = "1px solid black"; | |
| 195 views.style.width = views_width + "px"; | |
| 196 views.style.height = (win_height - output.offsetHeight - | |
| 197 output.offsetTop - 30) + "px"; | |
| 198 | |
| 199 selectors.style.position = "absolute"; | |
| 200 selectors.style.left = (views.offsetLeft + views_width + 1) + "px"; | |
| 201 selectors.style.top = views.offsetTop + "px"; | |
| 202 | |
| 203 viewCl(); | |
| 204 } | |
| 205 | |
| 206 function viewCl(target) { | |
| 207 document.getElementById("view-change").style.display = "block"; | |
| 208 } | |
| 209 | |
| 210 function initPlotSwitcher(tabs) { | |
| 211 for(var i = 0; i < tabs.length; i++) { | |
| 212 var anchor = document.createElement("a"); | |
| 213 anchor.appendChild(document.createTextNode(tabs[i])); | |
| 214 anchor.addEventListener("click", goToClosure(tabs[i]), false); | |
| 215 document.getElementById("switcher").appendChild(anchor); | |
| 216 } | |
| 217 | |
| 218 if ('lookout' in params) { | |
| 219 switcher.style.display = "none"; | |
| 220 details.style.display = "none"; | |
| 221 header_text.style.display = "none"; | |
| 222 explain.style.display = "none"; | |
| 223 selection.style.display = "none"; | |
| 224 } else { | |
| 225 document.getElementById("header_lookout").style.display = "none"; | |
| 226 } | |
| 227 } | |
| 228 | |
| 229 function log(data) { | |
| 230 document.getElementById('log').appendChild( | |
| 231 document.createTextNode(data + '\n')); | |
| 232 } | |
| 233 | |
| 234 function init() { | |
| 235 Fetch("summary.dat", onSummaryReceived); | |
| 236 } | |
| 237 | |
| 238 window.addEventListener("load", init, false); | |
| 239 </script> | |
| 240 </head> | |
| 241 <body> | |
| 242 <p> | |
| 243 <div id="header_lookout" align="center"> | |
| 244 <font style='color: #0066FF; font-family: Arial, serif;font-size: 20pt; font-w
eight: bold;'> | |
| 245 <script>document.write(Config.title);</script> | |
| 246 </font> | |
| 247 </div> | |
| 248 <div id="header_text"> | |
| 249 Builds generated by the <a href="http://build.chromium.org/">BUILD TYPE</a> buil
d | |
| 250 slave are run through the | |
| 251 <script> | |
| 252 document.write('<a href="' + Config.sourceLink + '">' + Config.title + '</a>'); | |
| 253 </script> | |
| 254 and the results of that test are charted here. | |
| 255 </div> | |
| 256 </p> | |
| 257 <p style="font-size: 0.75em; font-style: italic; color: rgb(100,100,100)"> | |
| 258 <div id="explain"> | |
| 259 The vertical axis is the time in milliseconds for the build to complete the | |
| 260 test, and the horizontal axis is the change-list for the build being | |
| 261 tested | |
| 262 </div> | |
| 263 </p> | |
| 264 <div id="switcher"> | |
| 265 | |
| 266 </div> | |
| 267 <div id="output"></div> | |
| 268 <div id="details"> | |
| 269 <div id="views"> | |
| 270 <iframe id="view-change"></iframe> | |
| 271 <iframe id="view-pages"></iframe> | |
| 272 </div> | |
| 273 <div id="selectors"> | |
| 274 <div class="selector" onclick="viewCl()">CL</div> | |
| 275 </div> | |
| 276 </div> | |
| 277 <pre id="log"></pre> | |
| 278 </body> | |
| 279 </html> | |
| OLD | NEW |