mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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,
|
||||
"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,6 +538,7 @@ class MachCommands(CommandBase):
|
|||
output = dict()
|
||||
|
||||
def parse_speedometer_result(result):
|
||||
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,
|
||||
|
@ -545,6 +546,17 @@ class MachCommands(CommandBase):
|
|||
'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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue