crafatar/test/benchmark.sh
2015-01-11 23:39:13 +01:00

18 lines
383 B
Bash
Executable File

#!/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
curl -sSL -o /dev/null -w "%{url_effective} %{http_code} %{time_total}s\\n" "$host/avatars/$id?helm"
done
}
time bench