Bug 1425058 - summarize stylebench scores properly. r=rwood,emilio
authorJoel Maher <jmaher@mozilla.com>
Tue, 06 Feb 2018 11:23:26 -0500
changeset 751782 7cae84b12528eb308530ba83fd307419eb71df15
parent 751781 1149bbf594f55fcfb51f17836611e10bae2d9e1c
child 751783 663a36bf36a34363e9e934abe63c586c8c370725
push id98047
push userbmo:continuation@gmail.com
push dateTue, 06 Feb 2018 22:02:37 +0000
reviewersrwood, emilio
bugs1425058
milestone60.0a1
Bug 1425058 - summarize stylebench scores properly. r=rwood,emilio
testing/talos/talos/output.py
--- a/testing/talos/talos/output.py
+++ b/testing/talos/talos/output.py
@@ -250,21 +250,40 @@ class Output(object):
         # the 16 test values, not the sub test values.
         if len(results) != 160:
             raise Exception("Speedometer has 160 subtests, found: %s instead" % len(results))
 
         results = results[9::10]
         score = 60 * 1000 / filter.geometric_mean(results) / correctionFactor
         return score
 
+    @classmethod
+    def stylebench_score(cls, val_list):
+        """
+        stylebench_score: https://bug-172968-attachments.webkit.org/attachment.cgi?id=319888
+        """
+        correctionFactor = 3
+        results = [i for i, j in val_list]
+        # stylebench has 4 tests, each of these are made of up 12 subtests
+        # and a sum of the 12 values.  We receive 52 values, and want to use
+        # the 4 test values, not the sub test values.
+        if len(results) != 52:
+            raise Exception("StyleBench has 52 subtests, found: %s instead" % len(results))
+
+        results = results[12::13]
+        score = 60 * 1000 / filter.geometric_mean(results) / correctionFactor
+        return score
+
     def construct_results(self, vals, testname):
         if 'responsiveness' in testname:
             return filter.responsiveness_Metric([val for (val, page) in vals])
         elif testname.startswith('v8_7'):
             return self.v8_Metric(vals)
         elif testname.startswith('kraken'):
             return self.JS_Metric(vals)
         elif testname.startswith('speedometer'):
             return self.speedometer_score(vals)
+        elif testname.startswith('stylebench'):
+            return self.stylebench_score(vals)
         elif len(vals) > 1:
             return filter.geometric_mean([i for i, j in vals])
         else:
             return filter.mean([i for i, j in vals])