aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorSamson <16504129+sagudev@users.noreply.github.com>2024-10-30 18:59:15 +0100
committerGitHub <noreply@github.com>2024-10-30 17:59:15 +0000
commitcf663309782c95166ac56a481c7bde9483284e5f (patch)
tree66f6d1f1b065f389b90e25189774430d1fcbc532 /python
parentade562e4810c534b3dc8189cb60868819d7ee888 (diff)
downloadservo-cf663309782c95166ac56a481c7bde9483284e5f.tar.gz
servo-cf663309782c95166ac56a481c7bde9483284e5f.zip
Fix `test-speedometer` (#34072)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Diffstat (limited to 'python')
-rw-r--r--python/servo/testing_commands.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 16ea7333758..6837f855afb 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -529,8 +529,8 @@ class MachCommands(CommandBase):
binary,
"https://servospeedometer.netlify.app?headless=1",
"--pref", "dom.allow_scripts_to_close_windows",
- "--resolution=1100x900",
- "--headless"], timeout=60).decode())
+ "--window-size=1100x900",
+ "--headless"], timeout=120).decode())
print(f"Score: {speedometer['Score']['mean']} ± {speedometer['Score']['delta']}")
@@ -538,13 +538,25 @@ class MachCommands(CommandBase):
output = dict()
def parse_speedometer_result(result):
- output[f"Speedometer/{result['name']}"] = {
- 'latency': { # speedometer has ms we need to convert to ns
- 'value': float(result['mean']) * 1000.0,
- 'lower_value': float(result['min']) * 1000.0,
- 'upper_value': float(result['max']) * 1000.0,
+ if result['unit'] == "ms":
+ output[f"Speedometer/{result['name']}"] = {
+ 'latency': { # speedometer has ms we need to convert to ns
+ 'value': float(result['mean']) * 1000.0,
+ 'lower_value': float(result['min']) * 1000.0,
+ 'upper_value': float(result['max']) * 1000.0,
+ }
}
- }
+ elif result['unit'] == "score":
+ output[f"Speedometer/{result['name']}"] = {
+ 'score': {
+ 'value': float(result['mean']),
+ 'lower_value': float(result['min']),
+ 'upper_value': float(result['max']),
+ }
+ }
+ else:
+ raise "Unknown unit!"
+
for child in result['children']:
parse_speedometer_result(child)