validity assertion fails after removing a child of an <optgroup> element
[WebKit-https.git] / Websites / perf.webkit.org / public / v3 / models / measurement-cluster.js
1 'use strict';
2
3 class MeasurementCluster {
4     constructor(response)
5     {
6         this._response = response;
7         this._adaptor = new MeasurementAdaptor(response['formatMap']);
8     }
9
10     startTime() { return this._response['startTime']; }
11     endTime() { return this._response['endTime']; }
12
13     addToSeries(series, configType, includeOutliers, idMap)
14     {
15         var rawMeasurements = this._response['configurations'][configType];
16         if (!rawMeasurements)
17             return;
18
19         var self = this;
20         rawMeasurements.forEach(function (row) {
21             var id = self._adaptor.extractId(row);
22             if (id in idMap)
23                 return;
24             if (self._adaptor.isOutlier(row) && !includeOutliers)
25                 return;
26
27             idMap[id] = true;
28
29             series.append(self._adaptor.applyTo(row));
30         });
31     }
32 }
33
34 if (typeof module != 'undefined')
35     module.exports.MeasurementCluster = MeasurementCluster;