Bug 1425058 - summarize stylebench scores properly. r=rwood,emilio

This commit is contained in:
Joel Maher 2018-02-06 11:23:26 -05:00
Родитель 09c3834e23
Коммит a78be3d8cb
1 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -255,6 +255,23 @@ class Output(object):
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])
@ -264,6 +281,8 @@ class Output(object):
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: