Skip to content

Commit eb2af7e

Browse files
nix(loadtest): group results by 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.
1 parent 3f8963b commit eb2af7e

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

nix/tools/loadtest.nix

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ let
262262
workingDir = "/";
263263
}
264264
''
265-
${vegeta}/bin/vegeta report -type=json "$_arg_file" \
265+
${vegeta}/bin/vegeta encode "$_arg_file" \
266+
| ${jq}/bin/jq --slurp 'map(select(.url != "")) | group_by(.url) | map({(.[0].url | sub("^http://postgrest";"")): add | .latency / length | 10e6 / . }) | .[]' \
266267
| ${jq}/bin/jq --arg branch "$(basename "$_arg_file" .bin)" '. + {branch: $branch}'
267268
'';
268269

@@ -276,10 +277,10 @@ let
276277
import pandas as pd
277278
278279
pd.read_json(sys.stdin) \
279-
.set_index('param') \
280-
.loc['rate'] \
280+
.set_index('rate') \
281+
.drop(['branch']) \
281282
.convert_dtypes() \
282-
.to_markdown(sys.stdout, floatfmt='.0f')
283+
.to_markdown(sys.stdout, floatfmt='.1f')
283284
'';
284285

285286

@@ -299,8 +300,8 @@ let
299300
echo -e "## Loadtest results $marker\n"
300301
301302
find loadtest -type f -iname '*.bin' -exec ${reporter} {} \; \
302-
| ${jq}/bin/jq '[paths(scalars) as $path | {param: $path | join("."), (.branch): getpath($path)}]' \
303-
| ${jq}/bin/jq --slurp 'flatten | group_by(.param) | map(add)' \
303+
| ${jq}/bin/jq '[paths(scalars) as $path | {rate: $path | join("."), (.branch): getpath($path)}]' \
304+
| ${jq}/bin/jq --slurp 'flatten | group_by(.rate) | map(add)' \
304305
| ${toMarkdown}
305306
306307
echo -e "\n\n## Loadtest elapsed seconds vs CPU/MEM usage $marker\n"

0 commit comments

Comments
 (0)