Title: [201238] trunk
Revision
201238
Author
[email protected]
Date
2016-05-20 20:57:34 -0700 (Fri, 20 May 2016)

Log Message

run-benchmark's results should contain Animometer's debug output
https://bugs.webkit.org/show_bug.cgi?id=157941

Reviewed by Stephanie Lewis.

PerformanceTests:

Made developer.html support the JSON generated by run-benchmark which stores everything under debugOutput.

* Animometer/resources/debug-runner/animometer.js:
(Utilities.initialize): Unwrap debugOutput in the case run-benchmark's result JSON is used.

Tools:

Modified the Animometer patch to store debug output and made benchmark_runner extract them together as a single array.
The result can be dragged and dropped into Animometer's developer.html page.

* Scripts/webkitpy/benchmark_runner/benchmark_runner.py:
(BenchmarkRunner._run_one_test): Parse JSON here instead of doing it in multiple call sites.
(BenchmarkRunner._run_benchmark): Strip debugOutput from individual test result, and merge them together separately.
* Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch:
Modified the patch to store the debug output.
* Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py:
(ServerControl.render_POST): Fixed a bug that POST to /report results in 500 because getvalue is not defined
when the request body is larger than a certain size on twisted.

Modified Paths

Diff

Modified: trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js (201237 => 201238)


--- trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js	2016-05-21 02:00:42 UTC (rev 201237)
+++ trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js	2016-05-21 03:57:34 UTC (rev 201238)
@@ -531,6 +531,8 @@
             reader.filename = file.name;
             reader._onload_ = function(e) {
                 var run = JSON.parse(e.target.result);
+                if (run.debugOutput instanceof Array)
+                    run = run.debugOutput[0];
                 benchmarkRunnerClient.results = new ResultsDashboard(run.options, run.data);
                 benchmarkController.showResults();
             };

Modified: trunk/PerformanceTests/ChangeLog (201237 => 201238)


--- trunk/PerformanceTests/ChangeLog	2016-05-21 02:00:42 UTC (rev 201237)
+++ trunk/PerformanceTests/ChangeLog	2016-05-21 03:57:34 UTC (rev 201238)
@@ -1,3 +1,15 @@
+2016-05-20  Ryosuke Niwa  <[email protected]>
+
+        run-benchmark's results should contain Animometer's debug output
+        https://bugs.webkit.org/show_bug.cgi?id=157941
+
+        Reviewed by Stephanie Lewis.
+
+        Made developer.html support the JSON generated by run-benchmark which stores everything under debugOutput.
+
+        * Animometer/resources/debug-runner/animometer.js:
+        (Utilities.initialize): Unwrap debugOutput in the case run-benchmark's result JSON is used.
+
 2016-05-18  Timothy Hatcher  <[email protected]>
 
         Make Animometer work in all browsers

Modified: trunk/Tools/ChangeLog (201237 => 201238)


--- trunk/Tools/ChangeLog	2016-05-21 02:00:42 UTC (rev 201237)
+++ trunk/Tools/ChangeLog	2016-05-21 03:57:34 UTC (rev 201238)
@@ -1,3 +1,22 @@
+2016-05-20  Ryosuke Niwa  <[email protected]>
+
+        run-benchmark's results should contain Animometer's debug output
+        https://bugs.webkit.org/show_bug.cgi?id=157941
+
+        Reviewed by Stephanie Lewis.
+
+        Modified the Animometer patch to store debug output and made benchmark_runner extract them together as a single array.
+        The result can be dragged and dropped into Animometer's developer.html page.
+
+        * Scripts/webkitpy/benchmark_runner/benchmark_runner.py:
+        (BenchmarkRunner._run_one_test): Parse JSON here instead of doing it in multiple call sites.
+        (BenchmarkRunner._run_benchmark): Strip debugOutput from individual test result, and merge them together separately.
+        * Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch:
+        Modified the patch to store the debug output.
+        * Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py:
+        (ServerControl.render_POST): Fixed a bug that POST to /report results in 500 because getvalue is not defined
+        when the request body is larger than a certain size on twisted.
+
 2016-05-20  Srinivasan Vijayaraghavan  <[email protected]>
 
         Use clearer names for JSON output of _javascript_core test results

Modified: trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py (201237 => 201238)


--- trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py	2016-05-21 02:00:42 UTC (rev 201237)
+++ trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py	2016-05-21 03:57:34 UTC (rev 201238)
@@ -78,10 +78,11 @@
             self._browser_driver.close_browsers()
             self._http_server_driver.kill_server()
 
-        return result
+        return json.loads(result)
 
     def _run_benchmark(self, count, web_root):
         results = []
+        debug_outputs = []
         for iteration in xrange(1, count + 1):
             _log.info('Start the iteration {current_iteration} of {iterations} for current benchmark'.format(current_iteration=iteration, iterations=count))
             try:
@@ -89,14 +90,16 @@
 
                 if 'entry_point' in self._plan:
                     result = self._run_one_test(web_root, self._plan['entry_point'])
+                    debug_outputs.append(result.pop('debugOutput', None))
                     assert(result)
-                    results.append(json.loads(result))
+                    results.append(result)
                 elif 'test_files' in self._plan:
                     run_result = {}
                     for test in self._plan['test_files']:
                         result = self._run_one_test(web_root, test)
                         assert(result)
-                        run_result = self._merge(run_result, json.loads(result))
+                        run_result = self._merge(run_result, result)
+                        debug_outputs.append(result.pop('debugOutput', None))
 
                     results.append(run_result)
                 else:
@@ -109,7 +112,8 @@
             _log.info('End the iteration {current_iteration} of {iterations} for current benchmark'.format(current_iteration=iteration, iterations=count))
 
         results = self._wrap(results)
-        self._dump(results, self._output_file if self._output_file else self._plan['output_file'])
+        output_file = self._output_file if self._output_file else self._plan['output_file']
+        self._dump(self._merge({'debugOutput': debug_outputs}, results), output_file)
         self.show_results(results, self._scale_unit)
 
     def execute(self):

Modified: trunk/Tools/Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch (201237 => 201238)


--- trunk/Tools/Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch	2016-05-21 02:00:42 UTC (rev 201237)
+++ trunk/Tools/Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch	2016-05-21 03:57:34 UTC (rev 201238)
@@ -2,7 +2,7 @@
 index b20a1c9..e434e89 100644
 --- a/resources/runner/animometer.js
 +++ b/resources/runner/animometer.js
-@@ -320,6 +320,57 @@ window.benchmarkRunnerClient = {
+@@ -320,6 +320,61 @@ window.benchmarkRunnerClient = {
      didFinishLastIteration: function()
      {
          benchmarkController.showResults();
@@ -37,7 +37,11 @@
 +    {
 +        var results = this.results.results[0];
 +        var iterationReports = this._computeIterationReports(results);
-+        return {"Animometer": {"metrics" : {"Score" : ["Geometric"]}, "tests" : iterationReports } };
++        var debugOutput = {
++            options: benchmarkRunnerClient.results.options,
++            data: benchmarkRunnerClient.results.data,
++        }
++        return {"Animometer": {"metrics" : {"Score" : ["Geometric"]}, "tests" : iterationReports }, "debugOutput": debugOutput};
 +    },
 +
 +    didFinishLastIteration: function()

Modified: trunk/Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py (201237 => 201238)


--- trunk/Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py	2016-05-21 02:00:42 UTC (rev 201237)
+++ trunk/Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py	2016-05-21 03:57:34 UTC (rev 201238)
@@ -27,7 +27,7 @@
 
     def render_POST(self, request):
         _log.info("Serving request %s" % request)
-        sys.stdout.write(request.content.getvalue())
+        sys.stdout.write(request.content.read())
         sys.stdout.flush()
         reactor.stop()
         return 'OK'
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to