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:
+17
-1
@@ -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',)
|
||||
)
|
||||
'';
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user