mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
add benchmark.sh
should be ran from inside test/ dir
This commit is contained in:
parent
28002c2aff
commit
35756cc724
19
test/benchmark.sh
Executable file
19
test/benchmark.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
host="$1"
|
||||||
|
if [ -z "$host" ]; then
|
||||||
|
echo "Usage: $0 <host uri> > benchmark.txt 2>&1"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# insert newline after uuids
|
||||||
|
id_file="$(echo | cat 'uuids.txt' - 'usernames.txt')"
|
||||||
|
mapfile ids <<< $id_file
|
||||||
|
|
||||||
|
bench() {
|
||||||
|
for id in $ids; do
|
||||||
|
id=`echo "$id" | tr -d "\r"`
|
||||||
|
curl -sSL -o /dev/null -w "%{url_effective} %{http_code} %{time_total}s\\n" "$host/avatars/$id?helm"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
time bench
|
||||||
Loading…
x
Reference in New Issue
Block a user