Relationship between A/B testing results are unclear
[WebKit-https.git] / Websites / perf.webkit.org / public / v2 / data.js
index 94d0fb24bc4cd2ed172f11f6214a1b99c0c818d1..9e521130f258453a07217020fad275a8377c2ab0 100755 (executable)
@@ -152,13 +152,18 @@ function Measurement(rawData)
     this._formattedRevisions = undefined;
 }
 
     this._formattedRevisions = undefined;
 }
 
+Measurement.prototype.revisionForRepository = function (repositoryId)
+{
+    var revisions = this._raw['revisions'];
+    var rawData = revisions[repositoryId];
+    return rawData ? rawData[0] : null;
+}
+
 Measurement.prototype.commitTimeForRepository = function (repositoryId)
 {
     var revisions = this._raw['revisions'];
     var rawData = revisions[repositoryId];
 Measurement.prototype.commitTimeForRepository = function (repositoryId)
 {
     var revisions = this._raw['revisions'];
     var rawData = revisions[repositoryId];
-    if (!rawData)
-        return null;
-    return new Date(rawData[1]);
+    return rawData ? new Date(rawData[1]) : null;
 }
 
 Measurement.prototype.formattedRevisions = function (previousMeasurement)
 }
 
 Measurement.prototype.formattedRevisions = function (previousMeasurement)
@@ -368,6 +373,17 @@ TimeSeries.prototype.findPointByBuild = function (buildId)
     return this._series.find(function (point) { return point.measurement.buildId() == buildId; })
 }
 
     return this._series.find(function (point) { return point.measurement.buildId() == buildId; })
 }
 
+TimeSeries.prototype.findPointByRevisions = function (revisions)
+{
+    return this._series.find(function (point, index) {
+        for (var repositoryId in revisions) {
+            if (point.measurement.revisionForRepository(repositoryId) != revisions[repositoryId])
+                return false;
+        }
+        return true;
+    });
+}
+
 TimeSeries.prototype.findPointByMeasurementId = function (measurementId)
 {
     return this._series.find(function (point) { return point.measurement.id() == measurementId; });
 TimeSeries.prototype.findPointByMeasurementId = function (measurementId)
 {
     return this._series.find(function (point) { return point.measurement.id() == measurementId; });