Perf dashboard should extend baseline and target to the future
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Nov 2015 21:12:43 +0000 (21:12 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Nov 2015 21:12:43 +0000 (21:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151511

Reviewed by Darin Adler.

* public/v2/data.js:
(RunsData.prototype.timeSeriesByCommitTime): Added extendToFuture as an argument.
(RunsData.prototype.timeSeriesByBuildTime): Ditto.
(RunsData.prototype._timeSeriesByTimeInternal): Ditto.
(TimeSeries): Add a new point to the end if extendToFuture is set and the series is not empty.
* public/v2/manifest.js:
(App.Manifest._formatFetchedData): Set extendToFuture to true for baselines and targets.

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

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/v2/data.js
Websites/perf.webkit.org/public/v2/manifest.js

index 8ca5680..9e3568d 100644 (file)
@@ -1,5 +1,20 @@
 2015-11-30  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Perf dashboard should extend baseline and target to the future
+        https://bugs.webkit.org/show_bug.cgi?id=151511
+
+        Reviewed by Darin Adler.
+
+        * public/v2/data.js:
+        (RunsData.prototype.timeSeriesByCommitTime): Added extendToFuture as an argument.
+        (RunsData.prototype.timeSeriesByBuildTime): Ditto.
+        (RunsData.prototype._timeSeriesByTimeInternal): Ditto.
+        (TimeSeries): Add a new point to the end if extendToFuture is set and the series is not empty.
+        * public/v2/manifest.js:
+        (App.Manifest._formatFetchedData): Set extendToFuture to true for baselines and targets.
+
+2015-11-30  Ryosuke Niwa  <rniwa@webkit.org>
+
         Perf dashboard should always show comparison to baseline and target even if one is missing
         https://bugs.webkit.org/show_bug.cgi?id=151510
 
index 665e395..42b3a77 100644 (file)
@@ -323,17 +323,17 @@ RunsData.prototype.count = function ()
     return this._measurements.length;
 }
 
-RunsData.prototype.timeSeriesByCommitTime = function (includeOutliers)
+RunsData.prototype.timeSeriesByCommitTime = function (includeOutliers, extendToFuture)
 {
-    return this._timeSeriesByTimeInternal(true, includeOutliers);
+    return this._timeSeriesByTimeInternal(true, includeOutliers, extendToFuture);
 }
 
-RunsData.prototype.timeSeriesByBuildTime = function (includeOutliers)
+RunsData.prototype.timeSeriesByBuildTime = function (includeOutliers, extendToFuture)
 {
-    return this._timeSeriesByTimeInternal(false, includeOutliers);
+    return this._timeSeriesByTimeInternal(false, includeOutliers, extendToFuture);
 }
 
-RunsData.prototype._timeSeriesByTimeInternal = function (useCommitType, includeOutliers)
+RunsData.prototype._timeSeriesByTimeInternal = function (useCommitType, includeOutliers, extendToFuture)
 {
     var series = new Array();
     var seriesIndex = 0;
@@ -349,7 +349,7 @@ RunsData.prototype._timeSeriesByTimeInternal = function (useCommitType, includeO
             markedOutlier: measurement.markedOutlier(),
         });
     }
-    return new TimeSeries(series);
+    return new TimeSeries(series, extendToFuture);
 }
 
 // FIXME: We need to devise a way to fetch runs in multiple chunks so that
@@ -420,13 +420,26 @@ RunsData.isSmallerBetter = function (unit)
     return unit != 'fps' && unit != '/s' && unit != 'pt';
 }
 
-function TimeSeries(series)
+// FIXME: Extending the baseline/target to the future should be a server-side configuration.
+function TimeSeries(series, extendToFuture)
 {
     this._series = series.sort(function (a, b) {
         var diff = a.time - b.time;
         return diff ? diff : a.secondaryTime - b.secondaryTime;
     });
 
+    if (extendToFuture && this._series.length) {
+        var lastPoint = this._series[this._series.length - 1];
+        this._series.push({
+            measurement: lastPoint.measurement,
+            time: Date.now() + 24 * 3600 * 1000,
+            secondaryTime: Date.now() + 24 * 3600 * 1000,
+            value: lastPoint.value,
+            interval: lastPoint.interval,
+            markedOutlier: lastPoint.markedOutlier,
+        });
+    }
+
     var self = this;
     var min = undefined;
     var max = undefined;
index 5186486..b006382 100644 (file)
@@ -365,12 +365,12 @@ App.Manifest = Ember.Controller.extend({
         var deltaFormatterWithoutSign = this._makeFormatter(unit, 2, false);
 
         var currentTimeSeries = configurations.current.timeSeriesByCommitTime(false);
-        var baselineTimeSeries = configurations.baseline ? configurations.baseline.timeSeriesByCommitTime(false) : null;
-        var targetTimeSeries = configurations.target ? configurations.target.timeSeriesByCommitTime(false) : null;
+        var baselineTimeSeries = configurations.baseline ? configurations.baseline.timeSeriesByCommitTime(false, true) : null;
+        var targetTimeSeries = configurations.target ? configurations.target.timeSeriesByCommitTime(false, true) : null;
 
         var unfilteredCurrentTimeSeries = configurations.current.timeSeriesByCommitTime(true);
-        var unfilteredBaselineTimeSeries = configurations.baseline ? configurations.baseline.timeSeriesByCommitTime(true) : null;
-        var unfilteredTargetTimeSeries = configurations.target ? configurations.target.timeSeriesByCommitTime(true) : null;
+        var unfilteredBaselineTimeSeries = configurations.baseline ? configurations.baseline.timeSeriesByCommitTime(true, true) : null;
+        var unfilteredTargetTimeSeries = configurations.target ? configurations.target.timeSeriesByCommitTime(true, true) : null;
 
         return {
             current: currentTimeSeries,