init benchmarks

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt
2024-04-05 05:32:40 +02:00
parent 2e0907af1e
commit a7cb808cad
9 changed files with 144 additions and 0 deletions

30
tests/benchmark/run.sh Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
BASE_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
function _k6 {
local filename="${1}"
"${BASE_DIR}/k6" \
run \
--out "web-dashboard=port=-1&report=${filename%.*}.html&period=1s&tag=name&tag=group&tag=user_count&tag=page_size" \
--out "json=${filename%.*}.json" \
"${@}"
}
filename=""
if [ "${#}" -ge 1 ]; then
filename="${1:-}"
shift
fi
if [ -f "${filename}" ]; then
_k6 "${filename}" "${@}"
else
find "${BASE_DIR}" -name '*.js' | while read -r f; do
_k6 "${f}" "${@}"
done
fi