Title: [204313] trunk/Websites/perf.webkit.org
Revision
204313
Author
[email protected]
Date
2016-08-09 16:22:05 -0700 (Tue, 09 Aug 2016)

Log Message

Don't filter out the latest data point in chart data sampling
https://bugs.webkit.org/show_bug.cgi?id=160714

Reviewed by Chris Dumez.

Exclude the last data point from sampling so that it's always included in the "sampled" charts data.
Without this, the last data point can change as we zoom out the time domain.

Luckily, we already had a mechanism to exclude the user selected point from sampling. Extend this
feature by supporting an array of point IDs instead of a single ID to exclude from filering.

* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype._sampleTimeSeries): Replaced exclusionPointID by excludedPoints. 

* public/v3/components/time-series-chart.js:
(TimeSeriesChart.prototype._ensureSampledTimeSeries): Put the last data point in excludedPoints.
(TimeSeriesChart.prototype._sampleTimeSeries): Check point's id against the list of IDs.

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (204312 => 204313)


--- trunk/Websites/perf.webkit.org/ChangeLog	2016-08-09 22:58:16 UTC (rev 204312)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2016-08-09 23:22:05 UTC (rev 204313)
@@ -1,5 +1,25 @@
 2016-08-09  Ryosuke Niwa  <[email protected]>
 
+        Don't filter out the latest data point in chart data sampling
+        https://bugs.webkit.org/show_bug.cgi?id=160714
+
+        Reviewed by Chris Dumez.
+
+        Exclude the last data point from sampling so that it's always included in the "sampled" charts data.
+        Without this, the last data point can change as we zoom out the time domain.
+
+        Luckily, we already had a mechanism to exclude the user selected point from sampling. Extend this
+        feature by supporting an array of point IDs instead of a single ID to exclude from filering.
+
+        * public/v3/components/interactive-time-series-chart.js:
+        (InteractiveTimeSeriesChart.prototype._sampleTimeSeries): Replaced exclusionPointID by excludedPoints. 
+
+        * public/v3/components/time-series-chart.js:
+        (TimeSeriesChart.prototype._ensureSampledTimeSeries): Put the last data point in excludedPoints.
+        (TimeSeriesChart.prototype._sampleTimeSeries): Check point's id against the list of IDs.
+
+2016-08-09  Ryosuke Niwa  <[email protected]>
+
         Build fix after r204187. interval has to be a getter, not a method.
 
         * public/v3/components/time-series-chart.js:

Modified: trunk/Websites/perf.webkit.org/public/v3/components/interactive-time-series-chart.js (204312 => 204313)


--- trunk/Websites/perf.webkit.org/public/v3/components/interactive-time-series-chart.js	2016-08-09 22:58:16 UTC (rev 204312)
+++ trunk/Websites/perf.webkit.org/public/v3/components/interactive-time-series-chart.js	2016-08-09 23:22:05 UTC (rev 204313)
@@ -383,10 +383,11 @@
         return metrics;
     }
 
-    _sampleTimeSeries(data, maximumNumberOfPoints, exclusionPointID)
+    _sampleTimeSeries(data, maximumNumberOfPoints, excludedPoints)
     {
-        console.assert(!exclusionPointID);
-        return super._sampleTimeSeries(data, maximumNumberOfPoints, this._indicatorID);
+        if (this._indicatorID)
+            excludedPoints.push(this._indicatorID);
+        return super._sampleTimeSeries(data, maximumNumberOfPoints, excludedPoints);
     }
 
     _renderChartContent(context, metrics)

Modified: trunk/Websites/perf.webkit.org/public/v3/components/time-series-chart.js (204312 => 204313)


--- trunk/Websites/perf.webkit.org/public/v3/components/time-series-chart.js	2016-08-09 22:58:16 UTC (rev 204312)
+++ trunk/Websites/perf.webkit.org/public/v3/components/time-series-chart.js	2016-08-09 23:22:05 UTC (rev 204313)
@@ -536,7 +536,7 @@
             if (!source.sampleData)
                 return filteredData;
             else
-                return self._sampleTimeSeries(filteredData, maximumNumberOfPoints);
+                return self._sampleTimeSeries(filteredData, maximumNumberOfPoints, filteredData.slice(-1).map(function (point) { return point.id; }));
         });
 
         Instrumentation.endMeasuringTime('TimeSeriesChart', 'ensureSampledTimeSeries');
@@ -547,7 +547,7 @@
         return true;
     }
 
-    _sampleTimeSeries(data, maximumNumberOfPoints, exclusionPointID)
+    _sampleTimeSeries(data, maximumNumberOfPoints, excludedPoints)
     {
         Instrumentation.startMeasuringTime('TimeSeriesChart', 'sampleTimeSeries');
 
@@ -571,7 +571,7 @@
             var j;
             for (j = i; j <= lastIndex; j++) {
                 var endPoint = data[j];
-                if (endPoint.id == exclusionPointID) {
+                if (excludedPoints.includes(endPoint.id)) {
                     j--;
                     break;
                 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to