nix(loadtest): group results by status, method and URL

Different requests hit different code paths and perform very
differently. By looking at each request type separately, we should be
able to get a much better idea of what kind of change in performance
we're looking at and where the root cause might be.

It will hopefully also allow us to migrate some of the other test-cases
into the main loadtest.
This commit is contained in:
Wolfgang Walther
2026-06-01 20:49:35 +00:00
parent 5cdf2e0569
commit 8a9f98371e
+7 -6
View File
@@ -267,7 +267,8 @@ let
workingDir = "/";
}
''
${vegeta}/bin/vegeta report -type=json "$_arg_file" \
${vegeta}/bin/vegeta encode "$_arg_file" \
| ${jq}/bin/jq --slurp 'map(select(.url != "")) | group_by("\(.code) \(.method) \(.url)") | map({("\(.[0].code) \(.[0].method) \(.[0].url)" | sub("http://postgrest";"")): add | .latency / length | 10e6 / . }) | .[]' \
| ${jq}/bin/jq --arg branch "$(basename "$_arg_file" .bin)" '. + {branch: $branch}'
'';
@@ -281,10 +282,10 @@ let
import pandas as pd
pd.read_json(sys.stdin) \
.set_index('param') \
.loc['rate'] \
.set_index('rate') \
.drop(['branch']) \
.convert_dtypes() \
.to_markdown(sys.stdout, floatfmt='.0f')
.to_markdown(sys.stdout, floatfmt='.1f')
'';
@@ -304,8 +305,8 @@ let
echo -e "## Loadtest results $marker\n"
find loadtest -type f -iname '*.bin' -exec ${reporter} {} \; \
| ${jq}/bin/jq '[paths(scalars) as $path | {param: $path | join("."), (.branch): getpath($path)}]' \
| ${jq}/bin/jq --slurp 'flatten | group_by(.param) | map(add)' \
| ${jq}/bin/jq '[paths(scalars) as $path | {rate: $path | join("."), (.branch): getpath($path)}]' \
| ${jq}/bin/jq --slurp 'flatten | group_by(.rate) | map(add)' \
| ${toMarkdown}
echo -e "\n\n## Loadtest elapsed seconds vs CPU/MEM usage $marker\n"