curlLoad

  • curl options
  • change SITE-NAME / ENDPOINT / WORD & run in a terminal

Get response size (byte)

curl -s 'https://SITE-NAME' | wc -c

Get response heads

curl -X HEAD -I 'https://SITE-NAME'

Get uniq count (info)

curl 'https://ENDPOINT' | awk 'BEGIN{RS=","}{print}' | grep 'WORD' | sort | uniq -c | sort -nr

Get uniq count from file

cat FILE-NAME | grep 'WORD' | awk '{print $8}' | sort | uniq -c | sort -nr > ~/uniqCountResult.txt

Get response time (sec)

for i in {1..10}; do echo $i; curl 'https://SITE-NAME' --write-out '%{http_code} %{time_total}\n' --silent --output /dev/null; done;

Save response time to curlLoadResult.txt

for i in {1..10}; do echo $i; curl 'https://SITE-NAME' --write-out '%{http_code} %{time_total}\n' --silent --output /dev/null >> curlLoadResult.txt; done; cat curlLoadResult.txt; awk '{ total += $2; count++ } END { print "\nMean: " total/count "\n" }' curlLoadResult.txt