benchmark.sh 416 B

12345678910111213141516171819
  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. id=`echo "$id" | tr -d "\r"`
  13. curl -sSL -o /dev/null -w "%{url_effective} %{http_code} %{time_total}s\\n" "$host/avatars/$id?helm"
  14. done
  15. }
  16. time bench