1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 23:24:09 +00:00
zap/wrk/measure.sh
Rene Schallner d0c59ab008 fixed AuthEndpoint callbacks, BasicAuth logging
AuthEndpoint callbacks now provide pointers to the original
SimpleEndpoint structs, so their fieldParentPtr calls work.
Added extensive debug() logging to BasicAuth with .UserPassword.
2023-05-01 05:55:08 +02:00

68 lines
1.4 KiB
Bash
Executable file

#! /usr/bin/env bash
THREADS=4
CONNECTIONS=400
DURATION_SECONDS=10
SUBJECT=$1
if [ "$SUBJECT" = "" ] ; then
echo "usage: $0 subject # subject: zig or go"
exit 1
fi
if [ "$SUBJECT" = "zig" ] ; then
zig build -Doptimize=ReleaseFast wrk > /dev/null
./zig-out/bin/wrk &
PID=$!
URL=http://127.0.0.1:3000
fi
if [ "$SUBJECT" = "zigstd" ] ; then
zig build -Doptimize=ReleaseFast wrk_zigstd > /dev/null
./zig-out/bin/wrk_zigstd &
PID=$!
URL=http://127.0.0.1:3000
fi
if [ "$SUBJECT" = "go" ] ; then
cd wrk/go && go build main.go
./main &
PID=$!
URL=http://127.0.0.1:8090/hello
fi
if [ "$SUBJECT" = "python" ] ; then
python wrk/python/main.py &
PID=$!
URL=http://127.0.0.1:8080
fi
if [ "$SUBJECT" = "sanic" ] ; then
python wrk/sanic/sanic-app.py &
PID=$!
URL=http://127.0.0.1:8000
fi
if [ "$SUBJECT" = "rust" ] ; then
cd wrk/rust/hello && cargo build --release
./target/release/hello &
PID=$!
URL=http://127.0.0.1:7878
fi
if [ "$SUBJECT" = "axum" ] ; then
cd wrk/axum/hello-axum && cargo build --release
./target/release/hello-axum &
PID=$!
URL=http://127.0.0.1:3000
fi
sleep 1
echo "========================================================================"
echo " $SUBJECT"
echo "========================================================================"
wrk -c $CONNECTIONS -t $THREADS -d $DURATION_SECONDS --latency $URL
kill $PID