Add graphics benchmark to performance bot
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 01:58:34 +0000 (01:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 01:58:34 +0000 (01:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150450

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-11-03
Reviewed by Chris Dumez.

* Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch: Added.
* Scripts/webkitpy/benchmark_runner/data/plans/animometer.plan: Added.
Add a patch and a plan to set the defaults of the benchmark, run it,
collect the result and report it to the benchmark runner.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192006 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch [new file with mode: 0644]
Tools/Scripts/webkitpy/benchmark_runner/data/plans/animometer.plan [new file with mode: 0644]

index 4927661..8b52354 100644 (file)
@@ -1,3 +1,15 @@
+2015-11-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
+        Add graphics benchmark to performance bot
+        https://bugs.webkit.org/show_bug.cgi?id=150450
+
+        Reviewed by Chris Dumez.
+
+        * Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch: Added.
+        * Scripts/webkitpy/benchmark_runner/data/plans/animometer.plan: Added.
+        Add a patch and a plan to set the defaults of the benchmark, run it,
+        collect the result and report it to the benchmark runner.
+
 2015-11-03  Jason Marcell  <jmarcell@apple.com>
 
         run-webkit-test should look in --root directory for LayoutTestRelay
diff --git a/Tools/Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch b/Tools/Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch
new file mode 100644 (file)
index 0000000..1b5f635
--- /dev/null
@@ -0,0 +1,96 @@
+diff --git a/runner/resources/animometer.js b/runner/resources/animometer.js
+index e567681..ba0ab0f 100644
+--- a/runner/resources/animometer.js
++++ b/runner/resources/animometer.js
+@@ -41,14 +41,62 @@ window.benchmarkRunnerClient = {
+         this._resultsDashboard.push(suitesSamplers);
+     },
+     
++    _computeTestReport: function(testName, testResults)
++    {
++        return [testResults[Strings["JSON_SCORE"][0]]];
++    },
++
++    _computeSuiteReports: function(suiteName, suiteResults)
++    {
++        var testsReports = {};
++
++        for (var testName in suiteResults[Strings["JSON_RESULTS"][2]]) {
++            var testReports = this._computeTestReport(testName, suiteResults[Strings["JSON_RESULTS"][2]][testName]);
++            testsReports[testName] = { "metrics": { "Score": { "current": testReports } } };
++        }
++
++        return testsReports;
++    },
++
++    _computeIterationReports: function(iterationResults)
++    {
++        var suitesReports = {};
++
++        for (var suiteName in iterationResults[Strings["JSON_RESULTS"][1]]) {
++            var testsReports = this._computeSuiteReports(suiteName, iterationResults[Strings["JSON_RESULTS"][1]][suiteName]);
++            suitesReports[suiteName] = { "metrics": { "Score": ["Geometric"] }, "tests": testsReports };
++        }
++
++        return suitesReports;
++    },
++
++    computeResultsReports: function()
++    {
++        var json = this._resultsDashboard.toJSON(false, false);
++        var iterationReports = this._computeIterationReports(json[Strings["JSON_RESULTS"][0]][0])
++        return {"Animometer": {"metrics" : {"Score" : ["Geometric"]}, "tests" : iterationReports } };
++    },
++
+     didFinishLastIteration: function ()
+     {
+-        var json = this._resultsDashboard.toJSON(true, true);
+-        this.score = json[Strings["JSON_SCORE"]];
+-        this._resultsTable.showIterations(json[Strings["JSON_RESULTS"][0]]);
+-        sectionsManager.showJSON("json", json[Strings["JSON_RESULTS"][0]][0]);
+-        suitesManager.updateLocalStorageFromJSON(json[Strings["JSON_RESULTS"][0]][0]);
+-        benchmarkController.showResults();
++        // submit result to server
++        var results = JSON.stringify(this.computeResultsReports());
++        var xhr = new XMLHttpRequest();
++        xhr.open("POST", "/report");
++
++        xhr.setRequestHeader("Content-type", "application/json");
++        xhr.setRequestHeader("Content-length", results.length);
++        xhr.setRequestHeader("Connection", "close");
++
++        xhr.onreadystatechange = function() {
++            if (xhr.readyState == XMLHttpRequest.DONE && xhr.status == 200) {
++                closeRequest = new XMLHttpRequest();
++                closeRequest.open("GET", "/shutdown");
++                closeRequest.send()
++            }
++        }
++
++        xhr.send(results);
+     }
+ }
+@@ -307,6 +355,10 @@ window.suitesManager =
+             suite.tests.forEach(function(test) {
+                 var testElement = this._createTestElement(listElement, test, suiteCheckbox);
++                if (index < 4) {
++                    var testCheckbox = this._checkboxElement(testElement);
++                    testCheckbox.checked = true;
++                }
+             }, this);
+         }, this);
+     },
+@@ -408,10 +460,8 @@ window.benchmarkController =
+     initialize: function()
+     {
+         sectionsManager.setupSectionStyle();
+-        optionsManager.updateUIFromLocalStorage();
+         suitesManager.createElements();
+-        suitesManager.updateUIFromLocalStorage();
+-        suitesManager.updateEditsElementsState();
++        setTimeout(this.startTest.bind(this), 3000);
+     },
+     onChangeAdaptiveTestCheckbox: function()
diff --git a/Tools/Scripts/webkitpy/benchmark_runner/data/plans/animometer.plan b/Tools/Scripts/webkitpy/benchmark_runner/data/plans/animometer.plan
new file mode 100644 (file)
index 0000000..d8e0a5f
--- /dev/null
@@ -0,0 +1,8 @@
+{
+    "timeout": 1800,
+    "count": 1,
+    "svn_source": "https://svn.webkit.org/repository/webkit/trunk/PerformanceTests/Animometer/@r191873",
+    "benchmark_patch": "data/patches/Animometer.patch",
+    "entry_point": "runner/animometer.html",
+    "output_file": "animometer.result"
+}
\ No newline at end of file