Highlight the alarming test results in the graphics benchmark results page
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Nov 2015 23:52:46 +0000 (23:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Nov 2015 23:52:46 +0000 (23:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151286

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-11-16
Reviewed by Simon Fraser.

When showing the results of a test in the graphics benchmark the following
criteria is going to be applied:

1. If the standard deviation of the test complexity or the frame rate is
   equal to or more than 10%, the standard deviation and the test name
   will be displayed in red.
2. If the average frame rate is not in the range = [(desired_frame_rate - 2)
   .. (desired_frame_rate + 2)], the average frame rate and the test name will
   be displayed in red.

* Animometer/resources/extensions.js:
(ResultsTable.prototype._showHeaderRow):
(ResultsTable.prototype._showHeader):
(ResultsTable.prototype._showEmptyCell):
(ResultsTable.prototype._showText):
(ResultsTable.prototype._showFixedNumber):
(ResultsTable.prototype.):
(ResultsTable.prototype._showGraph):
(ResultsTable.prototype._showJSON):
(ResultsTable.prototype._isAlarmingMeasurement):
(ResultsTable.prototype._isAlarmingTestResults):
(ResultsTable.prototype._showEmptyCells):
(ResultsTable.prototype._showEmptyRow):
(ResultsTable.prototype._showTest):
(ResultsTable.prototype._showSuite):
(ResultsTable.prototype._showIteration):
(ResultsTable.prototype.showRecord):
(ResultsTable.prototype.showIterations):
(ResultsTable.prototype._showEmpty): Deleted.
* Animometer/runner/resources/animometer.js:
(window.benchmarkRunnerClient.didFinishLastIteration):
* Animometer/tests/resources/stage.js:
(StageBenchmark.prototype.showResults):

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

PerformanceTests/Animometer/resources/extensions.js
PerformanceTests/Animometer/runner/resources/animometer.css
PerformanceTests/Animometer/runner/resources/animometer.js
PerformanceTests/Animometer/tests/resources/stage.js
PerformanceTests/ChangeLog

index a090eca..999ec92 100644 (file)
@@ -274,16 +274,14 @@ ResultsTable.prototype =
     _showHeaderRow: function(row, queue, headers, message)
     {
         headers.forEach(function (header) {
-            var th = document.createElement("th");
+            var th = DocumentExtension.createElement("th", {}, row);
             th.textContent = header.text;
             if (typeof message != "undefined" && message.length) {
-                th.appendChild(document.createElement('br'));
-                th.appendChild(document.createTextNode('[' + message +']'));
+                th.innerHTML += "<br>" + '[' + message +']';
                 message = "";
             }
             if ("width" in header)
                 th.width = header.width + "%";
-            row.appendChild(th);
             queue.push({element: th, headers: header.children });
         });
     },
@@ -323,37 +321,33 @@ ResultsTable.prototype =
         }
     },
     
-    _showEmpty: function(row)
+    _showEmptyCell: function(row, className)
     {
-        var td = document.createElement("td");
-        row.appendChild(td);
+        return DocumentExtension.createElement("td", { class: className }, row);
     },
 
-    _showText: function(row, text)
+    _showText: function(row, text, className)
     {
-        var td = document.createElement("td");
+        var td = DocumentExtension.createElement("td", { class: className }, row);
         td.textContent = text;
-        row.appendChild(td);
     },
 
-    _showFixedNumber: function(row, value, digits)
+    _showFixedNumber: function(row, value, digits, className)
     {
-        var td = document.createElement("td");
+        var td = DocumentExtension.createElement("td", { class: className }, row);
         td.textContent = value.toFixed(digits || 2);
-        row.appendChild(td);
     },
     
     _showGraph: function(row, testName, testResults)
     {
         var data = testResults[Strings["JSON_SAMPLES"][0]];
         if (!data) {
-            this._showEmpty(row);
+            this._showEmptyCell(row, "");
             return;
         }
         
-        var td = document.createElement("td");
-        var button = document.createElement("button");
-        button.className = "small-button";
+        var td = DocumentExtension.createElement("td", {}, row);
+        var button = DocumentExtension.createElement("button", { class: "small-button" }, td);
 
         button.addEventListener("click", function() {
             var samples = data[Strings["JSON_GRAPH"][0]];
@@ -363,40 +357,78 @@ ResultsTable.prototype =
         });
             
         button.textContent = Strings["TEXT_RESULTS"][1] + "...";
-        td.appendChild(button);
-        row.appendChild(td);
     },
 
     _showJSON: function(row, testName, testResults)
     {
         var data = testResults[Strings["JSON_SAMPLES"][0]];
         if (!data) {
-            this._showEmpty(row);
+            this._showEmptyCell(row, "");
             return;
         }
-        
-        var td = document.createElement("td");
-        var button = document.createElement("button");
-        button.className = "small-button";
+
+        var td = DocumentExtension.createElement("td", {}, row);
+        var button = DocumentExtension.createElement("button", { class: "small-button" }, td);
 
         button.addEventListener("click", function() {
             benchmarkController.showTestJSON(testName, testResults);
         });
             
         button.textContent = Strings["TEXT_RESULTS"][2] + "...";
-        td.appendChild(button);
-        row.appendChild(td);
+    },
+    
+    _isNoisyMeasurement: function(index, data, measurement, options)
+    {
+        const percentThreshold = 10;
+        const averageThreshold = 2;
+         
+        if (measurement == Strings["JSON_MEASUREMENTS"][3])
+            return data[Strings["JSON_MEASUREMENTS"][3]] >= percentThreshold;
+            
+        if (index == 1 && measurement == Strings["JSON_MEASUREMENTS"][0])
+            return Math.abs(data[Strings["JSON_MEASUREMENTS"][0]] - options["frame-rate"]) >= averageThreshold;
+
+        return false;
     },
 
-    _showTest: function(testName, testResults)
+    _isNoisyTest: function(testResults, options)
     {
-        var row = document.createElement("tr");
+        for (var index = 0; index < 2; ++index) {
+            var data = testResults[Strings["JSON_EXPERIMENTS"][index]];
+            for (var measurement in data) {
+                if (this._isNoisyMeasurement(index, data, measurement, options))
+                    return true;
+            }
+        }
+        return false;
+    },
+
+    _showEmptyCells: function(row, headers)
+    {
+        for (var index = 0; index < headers.length; ++index) {
+            if (!headers[index].children.length)
+                this._showEmptyCell(row, "suites-separator");
+            else
+                this._showEmptyCells(row, headers[index].children);
+        }
+    },
+
+    _showEmptyRow: function()
+    {
+        var row = DocumentExtension.createElement("tr", {}, this.element);
+        this._showEmptyCells(row, this._headers);
+    },
+
+    _showTest: function(testName, testResults, options)
+    {
+        var row = DocumentExtension.createElement("tr", {}, this.element);
+        var className = this._isNoisyTest(testResults, options) ? "noisy-results" : "";
         
         for (var index = 0; index < this._headers.length; ++index) {
 
             switch (index) {
             case 0:
-                this._showText(row, testName);
+                this._showText(row, testName, className);
                 break;
 
             case 1:
@@ -408,7 +440,7 @@ ResultsTable.prototype =
             case 3:
                 var data = testResults[Strings["JSON_EXPERIMENTS"][index - 2]];
                 for (var measurement in data)
-                    this._showFixedNumber(row, data[measurement], 2);
+                    this._showFixedNumber(row, data[measurement], 2, this._isNoisyMeasurement(index - 2, data, measurement, options) ? className : "");
                 break;
                 
             case 4:
@@ -417,38 +449,38 @@ ResultsTable.prototype =
                 break;
             }
         }
-        
-        this.element.appendChild(row);
     },
 
-    _showSuite: function(suiteName, suiteResults)
+    _showSuite: function(suiteName, suiteResults, options)
     {
         for (var testName in suiteResults[Strings["JSON_RESULTS"][2]]) {
-            this._showTest(testName, suiteResults[Strings["JSON_RESULTS"][2]][testName]);
+            this._showTest(testName, suiteResults[Strings["JSON_RESULTS"][2]][testName], options);
         }
     },
     
-    _showIteration : function(iterationResults)
+    _showIteration : function(iterationResults, options)
     {
         for (var suiteName in iterationResults[Strings["JSON_RESULTS"][1]]) {
-            this._showSuite(suiteName, iterationResults[Strings["JSON_RESULTS"][1]][suiteName]);
+            if (suiteName != Object.keys(iterationResults[Strings["JSON_RESULTS"][1]])[0])
+                this._showEmptyRow();
+            this._showSuite(suiteName, iterationResults[Strings["JSON_RESULTS"][1]][suiteName], options);
         }
     },
     
-    showRecord: function(testName, message, testResults)
+    showRecord: function(testName, message, testResults, options)
     {
         this.clear();
         this._showHeader(message);
-        this._showTest(testName, testResults);
+        this._showTest(testName, testResults, options);
     },
 
-    showIterations: function(iterationsResults)
+    showIterations: function(iterationsResults, options)
     {
         this.clear();
         this._showHeader("");
         
         iterationsResults.forEach(function(iterationResults) {
-            this._showIteration(iterationResults);
+            this._showIteration(iterationResults, options);
         }, this);
     }
 }
index 005ccc1..3c6c91d 100644 (file)
@@ -161,6 +161,14 @@ table.results-table {
     color: black;
 }
 
+.results-table td.noisy-results {
+    color: red;
+}
+
+.results-table td.suites-separator {
+    background-color: yellow;
+}
 /* -------------------------------------------------------------------------- */
 /*                              Results JSON                                  */
 /* -------------------------------------------------------------------------- */
index e567681..b875b6b 100644 (file)
@@ -45,7 +45,7 @@ window.benchmarkRunnerClient = {
     {
         var json = this._resultsDashboard.toJSON(true, true);
         this.score = json[Strings["JSON_SCORE"]];
-        this._resultsTable.showIterations(json[Strings["JSON_RESULTS"][0]]);
+        this._resultsTable.showIterations(json[Strings["JSON_RESULTS"][0]], this.options);
         sectionsManager.showJSON("json", json[Strings["JSON_RESULTS"][0]][0]);
         suitesManager.updateLocalStorageFromJSON(json[Strings["JSON_RESULTS"][0]][0]);
         benchmarkController.showResults();
index 35f8662..05b4f5d 100644 (file)
@@ -173,7 +173,7 @@ StageBenchmark.prototype.showResults = function(message, progress)
         return;
 
     if (this._options["show-running-results"])
-        this._recordTable.showRecord(this._test.name, message, this._sampler.toJSON(true, false));
+        this._recordTable.showRecord(this._test.name, message, this._sampler.toJSON(true, false), this._options);
 
     this._progressBar.setPos(progress);
 }
index d017a57..5d44bf7 100644 (file)
@@ -1,5 +1,46 @@
 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
+        Highlight the alarming test results in the graphics benchmark results page
+        https://bugs.webkit.org/show_bug.cgi?id=151286
+
+        Reviewed by Simon Fraser.
+        
+        When showing the results of a test in the graphics benchmark the following
+        criteria is going to be applied:
+        
+        1. If the standard deviation of the test complexity or the frame rate is
+           equal to or more than 10%, the standard deviation and the test name
+           will be displayed in red.
+        2. If the average frame rate is not in the range = [(desired_frame_rate - 2)
+           .. (desired_frame_rate + 2)], the average frame rate and the test name will
+           be displayed in red.
+
+        * Animometer/resources/extensions.js:
+        (ResultsTable.prototype._showHeaderRow):
+        (ResultsTable.prototype._showHeader):
+        (ResultsTable.prototype._showEmptyCell):
+        (ResultsTable.prototype._showText):
+        (ResultsTable.prototype._showFixedNumber):
+        (ResultsTable.prototype.):
+        (ResultsTable.prototype._showGraph):
+        (ResultsTable.prototype._showJSON):
+        (ResultsTable.prototype._isAlarmingMeasurement):
+        (ResultsTable.prototype._isAlarmingTestResults):
+        (ResultsTable.prototype._showEmptyCells):
+        (ResultsTable.prototype._showEmptyRow):
+        (ResultsTable.prototype._showTest):
+        (ResultsTable.prototype._showSuite):
+        (ResultsTable.prototype._showIteration):
+        (ResultsTable.prototype.showRecord):
+        (ResultsTable.prototype.showIterations):
+        (ResultsTable.prototype._showEmpty): Deleted.
+        * Animometer/runner/resources/animometer.js:
+        (window.benchmarkRunnerClient.didFinishLastIteration):
+        * Animometer/tests/resources/stage.js:
+        (StageBenchmark.prototype.showResults):
+
+2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
         Clean referencing the options object in the graphics benchmark
         https://bugs.webkit.org/show_bug.cgi?id=151284