Skip to content
Snippets Groups Projects
Commit a77685ac authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

result-compare: display percentage of change when applicable

This will help getting a grasp on what is changing.
parent 428fdb8a
No related branches found
No related tags found
No related merge requests found
Pipeline #57337 passed
......@@ -63,7 +63,9 @@
print(f'{prefix} {k} = {v}')
prefix = " #"
base = None
# display the result now
for r in some_results:
key = r['bin-env-vars']['hg']['changeset']['node'][:12]
median = r['result']['time']['median']
......@@ -66,8 +68,19 @@
# display the result now
for r in some_results:
key = r['bin-env-vars']['hg']['changeset']['node'][:12]
median = r['result']['time']['median']
print(f"{key}: {median:6.6f}")
if base is None:
base = median
display = ""
else:
change = median / base
if change <= 0.99:
perc = (1 - change) * -100
display = f"({perc:+.2f}%)".rjust(10)
elif 1.01 <= change:
perc = (change - 1) * 100
display = f"({perc:+.2f}%)".rjust(10)
print(f"{key}: {median:6.6f} {display}")
def _parsers():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment