Changeset 124802 in webkit


Ignore:
Timestamp:
Aug 6, 2012 2:59:06 PM (12 years ago)
Author:
rniwa@webkit.org
Message:

run-webkit-tests should have ability to add description to its JSON output
https://bugs.webkit.org/show_bug.cgi?id=93296

Reviewed by Dirk Pranke.

PerformanceTests:

Parse description and show it with the WebKit revision on the results page. Also use bar graphs
instead of line graphs since we're not depicting the time series here per arv's suggestion.
Finally, add the ability to adjust y-axis between the adjusted value and 0 (plot even doesn't adjust
y-axis automatically now) by a mouse click.

  • resources/results-template.html:

Tools:

Add --description option.

  • Scripts/webkitpy/performance_tests/perftestsrunner.py:

(PerfTestsRunner._parse_args):
(PerfTestsRunner._generate_and_show_results):
(PerfTestsRunner._generate_results_dict):

  • Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:

(test_run_with_description):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/ChangeLog

    r124702 r124802  
     12012-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
    1152012-08-04  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/PerformanceTests/resources/results-template.html

    r123985 r124802  
    4141<script>
    4242
    43 function attachPlot(testName) {
    44     var section = $('<section><h1></h1><div class="plot" style="width: 200px; height: 300px;"></div>'
     43function createPlot(testName) {
     44    var section = $('<section><h1></h1><div class="plot"></div>'
    4545        + '<span class="tooltip"></span><section>');
    4646    var unit = testUnits[testName];
     47    section.children('.plot').css({'width': 100 * maxLength + 'px', 'height': '300px'});
    4748    section.children('h1').html(testName + (unit ? ' (' + unit + ')' : ''));
    4849    $('#container').append(section);
     50   
     51    attachPlot(testName, section);
     52}
    4953
     54function attachPlot(testName, section, minIsZero) {
    5055    var averages = testResults[testName];
    5156    var color = 'rgb(230,50,50)';
     
    5358    var minMaxOptions = {lines: {show:true, lineWidth: 0},
    5459        color: color,
    55         points: {show: true, radius: 1}};
     60        points: {show: true, radius: 1},
     61        bars: {show: false}};
     62
    5663    function makeLowPlot(id, data) { return $.extend(true, {}, minMaxOptions, {id: id, data: data}); }   
    5764    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}); }
    5966
    6067    var plotData = [
     
    6875    $.plot(plotContainer, plotData, {
    6976        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,
    7279            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 += ' &dash; ' + 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        },
    7691        crosshair: { mode: 'y' },
    7792        series: { shadowSize: 0 },
     93        bars: {show: true, align: 'center', barWidth: 0.5},
    7894        lines: { show: false },
    7995        points: { show: true },
     
    8298            backgroundColor: '#fff',
    8399            hoverable: true,
    84             autoHighlight: true,
     100            autoHighlight: false,
    85101        }
    86102    });
     
    96112            tooltip.hide();
    97113    });
     114    plotContainer.mouseout(function () {
     115        tooltip.hide();
     116    });
     117
     118    plotContainer.click(function (event) {
     119        event.preventDefault();
     120        attachPlot(testName, section, !minIsZero);
     121    });
    98122}
    99123
     
    102126var testResults = {}, testResultsMin = {}, testResultsMax = {}, testResultsStdevLow = {}, testResultsStdevHigh = {};
    103127var testUnits = {};
     128var webkitRevisions = [];
     129var descriptions = [];
     130var maxLength = 0;
    104131$.each(results, function (index, entry) {
     132    webkitRevisions.push(entry['webkit-revision']);
     133    descriptions.push(entry['description']);
    105134    $.each(entry.results, function (test, result) {
    106135        if (tests.indexOf(test) < 0)
     
    126155            }
    127156        }
     157        maxLength = Math.max(maxLength, testResults[test].length);
    128158        testUnits[test] = result.unit;
    129159    });
    130160});
    131 $.each(tests.sort(), function (index, test) { attachPlot(test); });
     161$.each(tests.sort(), function (index, test) { createPlot(test); });
    132162
    133163</script>
  • trunk/Tools/ChangeLog

    r124801 r124802  
     12012-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
    1172012-08-06  Dirk Pranke  <dpranke@chromium.org>
    218
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py

    r124661 r124802  
    103103            optparse.make_option("--source-json-path",
    104104                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"),
    105107            optparse.make_option("--test-results-server",
    106108                help="Upload the generated JSON file to the specified server when --output-json-path is present."),
     
    171173            output_json_path = self._host.filesystem.join(self._port.perf_results_directory(), self._DEFAULT_JSON_FILENAME)
    172174
    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)
    174176
    175177        if options.source_json_path:
     
    194196            self._port.show_results_html_file(results_page_path)
    195197
    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):
    197199        contents = {'results': self._results}
     200        if description:
     201            contents['description'] = description
    198202        for (name, path) in self._port.repository_paths():
    199203            contents[name + '-revision'] = self._host.scm().svn_revision(path)
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py

    r124661 r124802  
    271271            "webkit-revision": 5678, "branch": "webkit-trunk"})
    272272
     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
    273283    def create_runner_and_setup_results_template(self, args=[]):
    274284        runner, port = self.create_runner(args)
Note: See TracChangeset for help on using the changeset viewer.