mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Fix test-speedometer
(#34072)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
ade562e481
commit
cf66330978
1 changed files with 20 additions and 8 deletions
|
@ -529,8 +529,8 @@ class MachCommands(CommandBase):
|
||||||
binary,
|
binary,
|
||||||
"https://servospeedometer.netlify.app?headless=1",
|
"https://servospeedometer.netlify.app?headless=1",
|
||||||
"--pref", "dom.allow_scripts_to_close_windows",
|
"--pref", "dom.allow_scripts_to_close_windows",
|
||||||
"--resolution=1100x900",
|
"--window-size=1100x900",
|
||||||
"--headless"], timeout=60).decode())
|
"--headless"], timeout=120).decode())
|
||||||
|
|
||||||
print(f"Score: {speedometer['Score']['mean']} ± {speedometer['Score']['delta']}")
|
print(f"Score: {speedometer['Score']['mean']} ± {speedometer['Score']['delta']}")
|
||||||
|
|
||||||
|
@ -538,13 +538,25 @@ class MachCommands(CommandBase):
|
||||||
output = dict()
|
output = dict()
|
||||||
|
|
||||||
def parse_speedometer_result(result):
|
def parse_speedometer_result(result):
|
||||||
output[f"Speedometer/{result['name']}"] = {
|
if result['unit'] == "ms":
|
||||||
'latency': { # speedometer has ms we need to convert to ns
|
output[f"Speedometer/{result['name']}"] = {
|
||||||
'value': float(result['mean']) * 1000.0,
|
'latency': { # speedometer has ms we need to convert to ns
|
||||||
'lower_value': float(result['min']) * 1000.0,
|
'value': float(result['mean']) * 1000.0,
|
||||||
'upper_value': float(result['max']) * 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']:
|
for child in result['children']:
|
||||||
parse_speedometer_result(child)
|
parse_speedometer_result(child)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue