Dashboard metrics page could show longest stretch of red
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Aug 2014 17:26:08 +0000 (17:26 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Aug 2014 17:26:08 +0000 (17:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136334

Reviewed by Sam Weinig.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js:
(Analyzer.prototype._updateStretchOfRedCounters):
(Analyzer.prototype._countPercentageOfGreen):
When counting percentage of green, also keep track of how long the page was red.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsView.js:
(MetricsView.prototype._update.addDivider):
(MetricsView.prototype._update.appendQueueResults):
Show it in aggregate queues (can't think of a reason to have it in individual ones).

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Metrics.css:
Changed to use an explicit divider element between green time and performance groups,
as there are too many combinations to easily express in CSS.

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

Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsView.js
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Metrics.css
Tools/ChangeLog

index bc34d4f..67bf3b9 100644 (file)
@@ -105,6 +105,24 @@ Analyzer.prototype = {
         return true;
     },
 
+    _updateStretchOfRedCounters: function(topIterationByQueue, currentTime, stretchOfRedCounters)
+    {
+        var isRedNow = false;
+        for (queueID in topIterationByQueue) {
+            if (!topIterationByQueue[queueID].successful) {
+                isRedNow = true;
+                break;
+            }
+        }
+        if (isRedNow) {
+            if (stretchOfRedCounters.currentStretchOfRedStart === undefined)
+                stretchOfRedCounters.currentStretchOfRedStart = currentTime;
+        } else if (stretchOfRedCounters.currentStretchOfRedStart !== undefined) {
+            stretchOfRedCounters.longestStretchOfRed = Math.max(stretchOfRedCounters.longestStretchOfRed, currentTime - stretchOfRedCounters.currentStretchOfRedStart);
+            stretchOfRedCounters.currentStretchOfRedStart = undefined;
+        }
+    },
+
     _countPercentageOfGreen: function(queues, result)
     {
         var topIterationByQueue = {};
@@ -131,9 +149,14 @@ Analyzer.prototype = {
         // Go forward in time, ignoring out of order iterations that didn't affect queue color.
         var currentTime = this._rangeStartTime;
         var greenTime = 0;
+        var stretchOfRedCounters = {
+            longestStretchOfRed: 0,
+            currentStretchOfRedStart: undefined
+        };
         var earliestTimeInRangeWhereAllQueuesHaveResults;
         if (this._allQueuesAreSuccessful(topIterationByQueue, queues) !== undefined)
             earliestTimeInRangeWhereAllQueuesHaveResults = this._rangeStartTime;
+        this._updateStretchOfRedCounters(topIterationByQueue, this._rangeStartTime, stretchOfRedCounters);
         for (var i = iterations.length - 1; i >= 0; --i) {
             if (iterations[i].endTime <= this._rangeStartTime) {
                 console.assert(iterations[i].queue.id in topIterationByQueue);
@@ -146,6 +169,7 @@ Analyzer.prototype = {
                     currentTime = iterations[i].endTime;
                     earliestTimeInRangeWhereAllQueuesHaveResults = currentTime;
                 }
+                this._updateStretchOfRedCounters(topIterationByQueue, currentTime, stretchOfRedCounters);
                 continue;
             }
             if (iterations[i].openSourceRevision <= topIterationByQueue[iterations[i].queue.id].openSourceRevision)
@@ -158,11 +182,17 @@ Analyzer.prototype = {
                 greenTime += iterations[i].endTime - currentTime;
 
             currentTime = iterations[i].endTime;
+            this._updateStretchOfRedCounters(topIterationByQueue, currentTime, stretchOfRedCounters);
         }
 
         if (this._allQueuesAreSuccessful(topIterationByQueue, queues) === true)
             greenTime += this._rangeEndTime - currentTime;
 
+        if (stretchOfRedCounters.currentStretchOfRedStart !== undefined)
+            stretchOfRedCounters.longestStretchOfRed = Math.max(stretchOfRedCounters.longestStretchOfRed, this._rangeEndTime - stretchOfRedCounters.currentStretchOfRedStart);
+
+        result.longestStretchOfRed = stretchOfRedCounters.longestStretchOfRed / 1000;
+
         if (earliestTimeInRangeWhereAllQueuesHaveResults === this._rangeStartTime)
             result.percentageOfGreen = greenTime / (this._rangeEndTime - this._rangeStartTime) * 100;
         else {
index 64665bb..8bcaf03 100644 (file)
@@ -90,6 +90,13 @@ MetricsView.prototype = {
             element.lastChild.classList.add("error-line");
         }
 
+        function addDivider(element)
+        {
+            var divider = document.createElement("div");
+            divider.classList.add("divider");
+            element.appendChild(divider);
+        }
+
         function appendQueueResults(queue)
         {
             if (!(queue.id in this._results))
@@ -97,13 +104,21 @@ MetricsView.prototype = {
 
             var result = this._results[queue.id];
 
-            if (result.buildbotRangeError && -1 === this._aggregatePseudoQueues.indexOf(queue))
+            var isAggregateQueue = -1 !== this._aggregatePseudoQueues.indexOf(queue);
+
+            if (result.buildbotRangeError && !isAggregateQueue)
                 addError(this.element, result.buildbotRangeErrorText);
 
             if ("percentageOfGreen" in result)
                 addLine(this.element, "Green " + Math.round(result.percentageOfGreen * 100) / 100 + "% of time");
 
-            if (queue.builder || -1 !== this._aggregatePseudoQueues.indexOf(queue)) {
+            if (isAggregateQueue && result.longestStretchOfRed) {
+                addLine(this.element, "Longest red: " + Math.round(result.longestStretchOfRed / 60) + " minutes");
+                addDivider(this.element);
+            } else if ("percentageOfGreen" in result)
+                addDivider(this.element);
+
+            if (queue.builder || isAggregateQueue) {
                 addLine(this.element, "Time from commit: ");
                 addLine(this.element, "Average: " + Math.round(result.averageSecondsFromCommit / 60) + " minutes");
                 addLine(this.element, "Median: " + Math.round(result.medianSecondsFromCommit / 60) + " minutes");
index 01cbeb3..09c6ec4 100644 (file)
@@ -58,7 +58,7 @@ table.aggregate-grid tr.headers th {
 .queue-view .error-line + .result-line,
 .result-line:first-child
 {
-    padding: 10px 0 6px 0;
+    padding: 10px 0 2px 0;
     font-weight: bold;
 }
 
@@ -66,6 +66,14 @@ table.aggregate-grid tr.headers th {
     color: rgb(191, 67, 41);
 }
 
+.queue-view .divider {
+    height: 6px;
+}
+
+table.aggregate-grid .queue-view .divider {
+    height: 10px;
+}
+
 .metrics-loading-indicator {
     font-family: "HelveticaNeue-Light", sans-serif;
     font-size: 14px;
index 28d7121..a832f34 100644 (file)
@@ -1,3 +1,24 @@
+2014-08-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Dashboard metrics page could show longest stretch of red
+        https://bugs.webkit.org/show_bug.cgi?id=136334
+
+        Reviewed by Sam Weinig.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js:
+        (Analyzer.prototype._updateStretchOfRedCounters):
+        (Analyzer.prototype._countPercentageOfGreen):
+        When counting percentage of green, also keep track of how long the page was red.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsView.js:
+        (MetricsView.prototype._update.addDivider):
+        (MetricsView.prototype._update.appendQueueResults):
+        Show it in aggregate queues (can't think of a reason to have it in individual ones).
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Metrics.css:
+        Changed to use an explicit divider element between green time and performance groups,
+        as there are too many combinations to easily express in CSS.
+
 2014-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Add webkit_uri_response_get_http_headers to WebKit2 GTK+ API