Bug 1657359 Add unity-webgl benchmark to browsertime mobile r=sparky,perftest-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D87861
This commit is contained in:
alexandru.ionescu 2020-09-15 16:11:36 +00:00
Родитель 639957d2c4
Коммит f4b4008f5e
5 изменённых файлов: 95 добавлений и 46 удалений

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

@ -347,6 +347,29 @@ browsertime-speedometer-mobile:
- --browsertime
- --test=speedometer
browsertime-unity-webgl-mobile:
description: "Browsertime Unity WebGL on Android"
apps: ["geckoview", "refbrow", "fenix"]
treeherder-symbol: Btime(ugl)
run-on-projects:
by-app:
geckoview:
by-test-platform:
android-hw-.*(?<!-shippable)/opt: []
android-hw-p2-.*api-16/pgo: []
android-hw-p2-.*api-16-shippable/opt: []
android-hw-(?!p2-.*api-16)/pgo: ['trunk', 'mozilla-beta']
android-hw-(?!p2-.*api-16)-shippable/opt: ['trunk', 'mozilla-beta']
default: ['mozilla-central', 'mozilla-beta']
default: []
max-run-time: 900
mozharness:
extra-options:
- --test=unity-webgl
fetches:
fetch:
- unity-webgl
browsertime-power:
description: "Browsertime Power Usage Tests on Android"
apps: ["geckoview", "fenix", "refbrow"]

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

@ -594,6 +594,7 @@ android-hw-aarch64-browsertime:
- browsertime-tp6m-profiling
- browsertime-speedometer-mobile
- browsertime-youtube-playback-mobile
- browsertime-unity-webgl-mobile
android-hw-arm7-browsertime:
- browsertime-power
@ -602,6 +603,7 @@ android-hw-arm7-browsertime:
- browsertime-tp6m-profiling
- browsertime-speedometer-mobile
- browsertime-youtube-playback-mobile
- browsertime-unity-webgl-mobile
linux-tsan-tests:
- mochitest-plain

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

@ -676,6 +676,52 @@ class PerftestOutput(object):
return subtests, vals
def parseUnityWebGLOutput(self, test):
"""
Example output (this is one page cycle):
{'name': 'raptor-unity-webgl-firefox',
'type': 'benchmark',
'measurements': {
'unity-webgl': [
[
'[{"benchmark":"Mandelbrot GPU","result":1035361},...}]'
]
]
},
'lower_is_better': False,
'unit': 'score'
}
"""
_subtests = {}
data = test["measurements"]["unity-webgl"]
for page_cycle in data:
data = json.loads(page_cycle[0])
for item in data:
# for each pagecycle, build a list of subtests and append all related replicates
sub = item["benchmark"]
if sub not in _subtests.keys():
# subtest not added yet, first pagecycle, so add new one
_subtests[sub] = {
"unit": test["subtest_unit"],
"alertThreshold": float(test["alert_threshold"]),
"lowerIsBetter": test["subtest_lower_is_better"],
"name": sub,
"replicates": [],
}
_subtests[sub]["replicates"].append(item["result"])
vals = []
subtests = []
names = _subtests.keys()
names.sort(reverse=True)
for name in names:
_subtests[name]["value"] = filters.median(_subtests[name]["replicates"])
subtests.append(_subtests[name])
vals.append([_subtests[name]["value"], name])
return subtests, vals
class RaptorOutput(PerftestOutput):
"""class for raptor output"""
@ -1224,52 +1270,6 @@ class RaptorOutput(PerftestOutput):
return subtests, vals
def parseUnityWebGLOutput(self, test):
"""
Example output (this is one page cycle):
{'name': 'raptor-unity-webgl-firefox',
'type': 'benchmark',
'measurements': {
'unity-webgl': [
[
'[{"benchmark":"Mandelbrot GPU","result":1035361},...}]'
]
]
},
'lower_is_better': False,
'unit': 'score'
}
"""
_subtests = {}
data = test["measurements"]["unity-webgl"]
for page_cycle in data:
data = json.loads(page_cycle[0])
for item in data:
# for each pagecycle, build a list of subtests and append all related replicates
sub = item["benchmark"]
if sub not in _subtests.keys():
# subtest not added yet, first pagecycle, so add new one
_subtests[sub] = {
"unit": test["subtest_unit"],
"alertThreshold": float(test["alert_threshold"]),
"lowerIsBetter": test["subtest_lower_is_better"],
"name": sub,
"replicates": [],
}
_subtests[sub]["replicates"].append(item["result"])
vals = []
subtests = []
names = _subtests.keys()
names.sort(reverse=True)
for name in names:
_subtests[name]["value"] = filters.median(_subtests[name]["replicates"])
subtests.append(_subtests[name])
vals.append([_subtests[name]["value"], name])
return subtests, vals
def parseAssortedDomOutput(self, test):
# each benchmark 'index' becomes a subtest; each pagecycle / iteration
# of the test has multiple values
@ -1515,6 +1515,8 @@ class BrowsertimeOutput(PerftestOutput):
subtests, vals = self.parseAresSixOutput(test)
if any("youtube-playback" in key for key in test["measurements"].keys()):
subtests, vals = self.parseYoutubePlaybackPerformanceOutput(test)
if "unity-webgl" in test["name"]:
subtests, vals = self.parseUnityWebGLOutput(test)
suite["subtests"] = subtests
# summarize results for both benchmark type tests

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

@ -53,3 +53,4 @@
# raptor-browsertime benchmark tests
[include:tests/benchmarks/youtube-playback.ini]
[include:tests/benchmarks/unity-webgl-mobile.ini]

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

@ -0,0 +1,21 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# unity-webgl benchmark for mobile browsers
[DEFAULT]
type = benchmark
test_url = http://<host>:<port>/unity-webgl/index.html?raptor
page_cycles = 5
page_timeout = 420000 # 7 mins
apps = geckoview, refbrow, fenix
unit = score
lower_is_better = false
alert_threshold = 2.0
gecko_profile_interval = 1
gecko_profile_entries = 8000000
fetch_task = unity-webgl
[unity-webgl]
page_cycles = 1