Created
July 5, 2017 15:28
-
-
Save NSkelsey/4cb78d6e3c3cc322e44ff7f4229f7202 to your computer and use it in GitHub Desktop.
test_resp_time.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
set -e | |
TT=`tty` | |
BASE='http://localhost:8082' | |
printf 'Logging into service %s\n\n' $BASE | |
read session_id < <(curl -s -A 'test-script' \ | |
-X POST -H 'Content-type: application/json' \ | |
-d '{"password": "aDMIN-PASSWORD","username":"admin"}' \ | |
$BASE/authentication | tee -p $TT | python -c 'import json, sys; print(json.loads(sys.stdin.read())["session_id"]);' | |
) | |
printf '\nAcquired session_id: %s\n' $session_id | |
printf '\nTesting response times\n\n' | |
curl -vvv -A 'test-script' \ | |
-H "X-Session: $session_id" \ | |
-w "|%{time_total}" \ | |
-o /dev/null \ | |
"$BASE/admin/users" & | |
curl -vvv -A 'test-script' \ | |
-H "X-Session: $session_id" \ | |
-w "|%{time_total}" \ | |
-o /dev/null \ | |
"$BASE/admin/receivers" & | |
curl -vvv -A 'test-script' \ | |
-H "X-Session: $session_id" \ | |
-o /dev/null \ | |
-w "|%{time_total}" \ | |
"$BASE/admin/fieldtemplate" & | |
curl -vvv -A 'test-script' \ | |
-H "X-Session: $session_id" \ | |
-o /dev/null \ | |
-w "|%{time_total}" \ | |
"$BASE/admin/node" & | |
curl -vvv -A 'test-script' \ | |
-H "X-Session: $session_id" \ | |
-w "|%{time_total}" \ | |
-o /dev/null \ | |
"$BASE/admin/notification" & | |
curl -vvv -A 'test-script' \ | |
-H "X-Session: $session_id" \ | |
-w "|%{time_total}" \ | |
-o /dev/null \ | |
"$BASE/admin/shorturls" & | |
curl -vvv -A 'test-script' \ | |
-H "X-Session: $session_id" \ | |
-w "|%{time_total}" \ | |
-o /dev/null \ | |
"$BASE/admin/anonmalies" & | |
curl -vvv -A 'test-script' \ | |
-H "X-Session: $session_id" \ | |
-o /dev/null \ | |
-w "|%{time_total}" \ | |
"$BASE/admin/overview/tips" & | |
curl -vvv -A 'test-script' \ | |
-H "X-Session: $session_id" \ | |
-o /dev/null \ | |
-w "|%{time_total}" \ | |
"$BASE/admin/overview/files" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment