nix(loadtest): report percentage change

This reports the percentage change between the current head branch and
the main branch, which is exactly the number we'll want to make our
decisions on "success or fail" on.

CI failures will initially be reported for regressions of 5% or more on
an individual number.
This commit is contained in:
Wolfgang Walther
2026-06-01 20:49:35 +00:00
parent ff92846e64
commit 1d6e0bd35f
2 changed files with 46 additions and 2 deletions
+17 -1
View File
@@ -274,12 +274,28 @@ let
import sys
import pandas as pd
def evaluate_change(df):
return ((df['head'] / df['main'] - 1) * 100) \
.map(lambda r: "{icon} {ratio:.1f} %".format(
ratio=r,
# Hardcoded failure threshold for CI is 5% here.
icon="" if r < 5 else ":x:"
))
pd.read_json(sys.stdin) \
.rename(columns={'latency': sys.argv[1]}) \
.set_index(sys.argv[1]) \
.drop(['branch']) \
.convert_dtypes() \
.to_markdown(sys.stdout, floatfmt='.1f')
.assign(change=evaluate_change) \
.to_markdown(
sys.stdout,
floatfmt='.1f',
colglobalalign='right',
colalign=('left',)
)
'';