From 8a9f98371edfe6e1a3d0fa92effa90b38d2487aa Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 8 May 2026 22:27:57 +0200 Subject: [PATCH] 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. --- nix/tools/loadtest.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nix/tools/loadtest.nix b/nix/tools/loadtest.nix index 9831efe4c..c9538daac 100644 --- a/nix/tools/loadtest.nix +++ b/nix/tools/loadtest.nix @@ -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"