benchmark.sh 383 B

123456789101112131415161718
  1. #!/usr/bin/env bash
  2. host="$1"
  3. if [ -z "$host" ]; then
  4. echo "Usage: $0 <host uri> > benchmark.txt 2>&1"
  5. exit 1
  6. fi
  7. # insert newline after uuids
  8. id_file="$(echo | cat 'uuids.txt' - 'usernames.txt')"
  9. mapfile ids <<< $id_file
  10. bench() {
  11. for id in $ids; do
  12. curl -sSL -o /dev/null -w "%{url_effective} %{http_code} %{time_total}s\\n" "$host/avatars/$id?helm"
  13. done
  14. }
  15. time bench