Add the support for reporting Speedometer 2.0 results to perf dashboard
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jan 2018 20:38:37 +0000 (20:38 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jan 2018 20:38:37 +0000 (20:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182089
<rdar://problem/36172346>

Rubber-stamped by Chris Dumez.

Apparently, this has always worked since the very first version of the perf dashboard added in r163688.
The relevant code is at the line 313 of report-processor.php now.

Added regression tests for this feature since we didn't have any tests four years ago.

* server-tests/api-report-tests.js:

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

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/server-tests/api-report-tests.js

index 60e669f..8d001f8 100644 (file)
@@ -1,5 +1,20 @@
 2018-01-29  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Add the support for reporting Speedometer 2.0 results to perf dashboard
+        https://bugs.webkit.org/show_bug.cgi?id=182089
+        <rdar://problem/36172346>
+
+        Rubber-stamped by Chris Dumez.
+
+        Apparently, this has always worked since the very first version of the perf dashboard added in r163688.
+        The relevant code is at the line 313 of report-processor.php now.
+
+        Added regression tests for this feature since we didn't have any tests four years ago.
+
+        * server-tests/api-report-tests.js:
+
+2018-01-29  Ryosuke Niwa  <rniwa@webkit.org>
+
         REGRESSION(r225898): The perf dashboard fails to open when there are no summary pages
         https://bugs.webkit.org/show_bug.cgi?id=182210
 
index 3b40d45..d0d0d32 100644 (file)
@@ -554,6 +554,96 @@ describe("/api/report", function () {
         });
     });
 
+    it("should be able to compute the aggregation of differently aggregated values", async () => {
+        const reportWithDifferentAggregators = {
+            "buildNumber": "123",
+            "buildTime": "2013-02-28T10:12:03.388304",
+            "builderName": "someBuilder",
+            "builderPassword": "somePassword",
+            "platform": "Mountain Lion",
+            "tests": {
+                "DummyBenchmark": {
+                    "metrics": {"Time": ["Arithmetic"]},
+                    "tests": {
+                        "DOM": {
+                            "metrics": {"Time": ["Total"]},
+                            "tests": {
+                                "ModifyNodes": {"metrics": {"Time": { "current": [[1, 2], [3, 4]] }}},
+                                "TraverseNodes": {"metrics": {"Time": { "current": [[11, 12], [13, 14]] }}}
+                            }
+                        },
+                        "CSS": {"metrics": {"Time": { "current": [[21, 22], [23, 24]] }}}
+                    }
+                }
+            },
+            "revisions": {
+                "macOS": {
+                    "revision": "10.8.2 12C60"
+                },
+                "WebKit": {
+                    "revision": "141977",
+                    "timestamp": "2013-02-06T08:55:20.9Z"
+                }
+            }};
+
+        await reportAfterAddingBuilderAndAggregators(reportWithDifferentAggregators);
+        const result = await fetchTestRunIterationsForMetric('DummyBenchmark', 'Time');
+
+        const run = result.run;
+        const runId = run['id'];
+        const expectedIterations = [];
+        let sum = 0;
+        let squareSum = 0;
+        for (let i = 0; i < 4; ++i) {
+            const value = i + 1;
+            const DOMTotal = (value + 10 + value);
+            const expectedValue = (DOMTotal + (20 + value)) / 2;
+            sum += expectedValue;
+            squareSum += expectedValue * expectedValue;
+            expectedIterations.push({run: runId, order: i, group: Math.floor(i / 2), value: expectedValue, relative_time: null});
+        }
+        assert.deepEqual(result.iterations, expectedIterations);
+        assert.equal(run['mean_cache'], sum / result.iterations.length);
+        assert.equal(run['sum_cache'], sum);
+        assert.equal(run['square_sum_cache'], squareSum);
+    });
+
+    it("should reject a report when there are more than non-matching aggregators in a subtest", async () => {
+        const reportWithAmbigiousAggregators = {
+            "buildNumber": "123",
+            "buildTime": "2013-02-28T10:12:03.388304",
+            "builderName": "someBuilder",
+            "builderPassword": "somePassword",
+            "platform": "Mountain Lion",
+            "tests": {
+                "DummyBenchmark": {
+                    "metrics": {"Time": ["Arithmetic"]},
+                    "tests": {
+                        "DOM": {
+                            "metrics": {"Time": ["Total", "Geometric"]},
+                            "tests": {
+                                "ModifyNodes": {"metrics": {"Time": { "current": [[1, 2], [3, 4]] }}},
+                                "TraverseNodes": {"metrics": {"Time": { "current": [[11, 12], [13, 14]] }}}
+                            }
+                        },
+                        "CSS": {"metrics": {"Time": { "current": [[21, 22], [23, 24]] }}}
+                    }
+                }
+            },
+            "revisions": {
+                "macOS": {
+                    "revision": "10.8.2 12C60"
+                },
+                "WebKit": {
+                    "revision": "141977",
+                    "timestamp": "2013-02-06T08:55:20.9Z"
+                }
+            }};
+
+        const response = await reportAfterAddingBuilderAndAggregatorsWithResponse(reportWithAmbigiousAggregators);
+        assert.equal(response['status'], 'NoMatchingAggregatedValueInSubtest');
+    });
+
     function reportWithSameSubtestName()
     {
         return {