Skip to content

Instantly share code, notes, and snippets.

@flushentitypacket
Last active July 18, 2020 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushentitypacket/3ed76c580d2b2af8e808aaa25bfaf87b to your computer and use it in GitHub Desktop.
Save flushentitypacket/3ed76c580d2b2af8e808aaa25bfaf87b to your computer and use it in GitHub Desktop.
Bash script to execute a parallel load test against some endpoint and print out the network latency data
#!/usr/bin/env bash
seq 1000 | \
time xargs -Idonotmatch -P 1000 \
curl "https://some.domain.here/path/to/resource?param=foo" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--write-out 'http_code:%{http_code} time_appconnect:%{time_appconnect} time_connect:%{time_connect} time_namelookup:%{time_namelookup} time_pretransfer:%{time_pretransfer} time_starttransfer:%{time_starttransfer} time_total:%{time_total}\n' \
--http1.1 -s -o /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment