Changeset 124802 in webkit
- Timestamp:
- Aug 6, 2012 2:59:06 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PerformanceTests/ChangeLog
r124702 r124802 1 2012-08-06 Ryosuke Niwa <rniwa@webkit.org> 2 3 run-webkit-tests should have ability to add description to its JSON output 4 https://bugs.webkit.org/show_bug.cgi?id=93296 5 6 Reviewed by Dirk Pranke. 7 8 Parse description and show it with the WebKit revision on the results page. Also use bar graphs 9 instead of line graphs since we're not depicting the time series here per arv's suggestion. 10 Finally, add the ability to adjust y-axis between the adjusted value and 0 (plot even doesn't adjust 11 y-axis automatically now) by a mouse click. 12 13 * resources/results-template.html: 14 1 15 2012-08-04 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/PerformanceTests/resources/results-template.html
r123985 r124802 41 41 <script> 42 42 43 function attachPlot(testName) {44 var section = $('<section><h1></h1><div class="plot" style="width: 200px; height: 300px;"></div>'43 function createPlot(testName) { 44 var section = $('<section><h1></h1><div class="plot"></div>' 45 45 + '<span class="tooltip"></span><section>'); 46 46 var unit = testUnits[testName]; 47 section.children('.plot').css({'width': 100 * maxLength + 'px', 'height': '300px'}); 47 48 section.children('h1').html(testName + (unit ? ' (' + unit + ')' : '')); 48 49 $('#container').append(section); 50 51 attachPlot(testName, section); 52 } 49 53 54 function attachPlot(testName, section, minIsZero) { 50 55 var averages = testResults[testName]; 51 56 var color = 'rgb(230,50,50)'; … … 53 58 var minMaxOptions = {lines: {show:true, lineWidth: 0}, 54 59 color: color, 55 points: {show: true, radius: 1}}; 60 points: {show: true, radius: 1}, 61 bars: {show: false}}; 62 56 63 function makeLowPlot(id, data) { return $.extend(true, {}, minMaxOptions, {id: id, data: data}); } 57 64 function makeHighPlot(from, to, fill, data) { return $.extend(true, {}, minMaxOptions, 58 {id: to, data: data , lines: {fill: fill}, fillBetween: from}); }65 {id: to, data: data}); } 59 66 60 67 var plotData = [ … … 68 75 $.plot(plotContainer, plotData, { 69 76 xaxis: { 70 min: averages[0][0] - 0. 25,71 max: averages[averages.length - 1][0] + 0. 25,77 min: averages[0][0] - 0.5, 78 max: averages[averages.length - 1][0] + 0.5, 72 79 tickSize: 1, 73 tickDecimals: 0, 74 tickFormatter: function (x) { return x >= 0 ? x : ''; }}, 75 yaxis: {}, 80 ticks: averages.map(function (value, index) { 81 var label = 'r' + webkitRevisions[index]; 82 if (descriptions[index]) 83 label += ' ‐ ' + descriptions[index] 84 return [index, label]; 85 }), 86 }, 87 yaxis: { 88 min: minIsZero ? 0 : Math.max.apply(Math, $.map(testResultsMin[testName], function (entry) { return entry[1]; })) * 0.98, 89 max: Math.max.apply(Math, $.map(testResultsMax[testName], function (entry) { return entry[1]; })) * (minIsZero ? 1.1 : 1.01), 90 }, 76 91 crosshair: { mode: 'y' }, 77 92 series: { shadowSize: 0 }, 93 bars: {show: true, align: 'center', barWidth: 0.5}, 78 94 lines: { show: false }, 79 95 points: { show: true }, … … 82 98 backgroundColor: '#fff', 83 99 hoverable: true, 84 autoHighlight: true,100 autoHighlight: false, 85 101 } 86 102 }); … … 96 112 tooltip.hide(); 97 113 }); 114 plotContainer.mouseout(function () { 115 tooltip.hide(); 116 }); 117 118 plotContainer.click(function (event) { 119 event.preventDefault(); 120 attachPlot(testName, section, !minIsZero); 121 }); 98 122 } 99 123 … … 102 126 var testResults = {}, testResultsMin = {}, testResultsMax = {}, testResultsStdevLow = {}, testResultsStdevHigh = {}; 103 127 var testUnits = {}; 128 var webkitRevisions = []; 129 var descriptions = []; 130 var maxLength = 0; 104 131 $.each(results, function (index, entry) { 132 webkitRevisions.push(entry['webkit-revision']); 133 descriptions.push(entry['description']); 105 134 $.each(entry.results, function (test, result) { 106 135 if (tests.indexOf(test) < 0) … … 126 155 } 127 156 } 157 maxLength = Math.max(maxLength, testResults[test].length); 128 158 testUnits[test] = result.unit; 129 159 }); 130 160 }); 131 $.each(tests.sort(), function (index, test) { attachPlot(test); });161 $.each(tests.sort(), function (index, test) { createPlot(test); }); 132 162 133 163 </script> -
trunk/Tools/ChangeLog
r124801 r124802 1 2012-08-06 Ryosuke Niwa <rniwa@webkit.org> 2 3 run-webkit-tests should have ability to add description to its JSON output 4 https://bugs.webkit.org/show_bug.cgi?id=93296 5 6 Reviewed by Dirk Pranke. 7 8 Add --description option. 9 10 * Scripts/webkitpy/performance_tests/perftestsrunner.py: 11 (PerfTestsRunner._parse_args): 12 (PerfTestsRunner._generate_and_show_results): 13 (PerfTestsRunner._generate_results_dict): 14 * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py: 15 (test_run_with_description): 16 1 17 2012-08-06 Dirk Pranke <dpranke@chromium.org> 2 18 -
trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
r124661 r124802 103 103 optparse.make_option("--source-json-path", 104 104 help="Path to a JSON file to be merged into the JSON file when --output-json-path is present."), 105 optparse.make_option("--description", 106 help="Add a description to the output JSON file if one is generated"), 105 107 optparse.make_option("--test-results-server", 106 108 help="Upload the generated JSON file to the specified server when --output-json-path is present."), … … 171 173 output_json_path = self._host.filesystem.join(self._port.perf_results_directory(), self._DEFAULT_JSON_FILENAME) 172 174 173 output = self._generate_results_dict(self._timestamp, options. platform, options.builder_name, options.build_number)175 output = self._generate_results_dict(self._timestamp, options.description, options.platform, options.builder_name, options.build_number) 174 176 175 177 if options.source_json_path: … … 194 196 self._port.show_results_html_file(results_page_path) 195 197 196 def _generate_results_dict(self, timestamp, platform, builder_name, build_number):198 def _generate_results_dict(self, timestamp, description, platform, builder_name, build_number): 197 199 contents = {'results': self._results} 200 if description: 201 contents['description'] = description 198 202 for (name, path) in self._port.repository_paths(): 199 203 contents[name + '-revision'] = self._host.scm().svn_revision(path) -
trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
r124661 r124802 271 271 "webkit-revision": 5678, "branch": "webkit-trunk"}) 272 272 273 def test_run_with_description(self): 274 runner, port = self.create_runner(args=['--output-json-path=/mock-checkout/output.json', 275 '--test-results-server=some.host', '--description', 'some description']) 276 self._test_run_with_json_output(runner, port.host.filesystem) 277 self.assertEqual(json.loads(port.host.filesystem.read_text_file('/mock-checkout/output.json')), { 278 "timestamp": 123456789, "description": "some description", "results": 279 {"Bindings/event-target-wrapper": {"max": 1510, "avg": 1489.05, "median": 1487, "min": 1471, "stdev": 14.46, "unit": "ms"}, 280 "inspector/pass.html:group_name:test_name": 42}, 281 "webkit-revision": 5678, "branch": "webkit-trunk"}) 282 273 283 def create_runner_and_setup_results_template(self, args=[]): 274 284 runner, port = self.create_runner(args)
Note: See TracChangeset
for help on using the changeset viewer.