Skip to content

Instantly share code, notes, and snippets.

@pboothe
Created December 16, 2015 22:55
Show Gist options
  • Save pboothe/87ec9e0eea44acbbdc4b to your computer and use it in GitHub Desktop.
Save pboothe/87ec9e0eea44acbbdc4b to your computer and use it in GitHub Desktop.
#!/bin/bash
SERVER=XXXXX
if [ ! -d stress_test_results ]
then
echo You need to create a directory called stress_test_results
exit 1
fi
mkdir stress_test_results/ws
mkdir stress_test_results/wss
mkdir stress_test_results/raw
function run_ws_tests {
X=0
while [ $X -lt 1000 ]
do
X=$[$X + 1]
TMPFILE=$(mktemp --tmpdir=stress_test_results/ws)
date >> ${TMPFILE}
node node_tests/ndt_client.js --server=${SERVER} --port=3001 --protocol=ws --debug 2>&1 >> ${TMPFILE}
echo Exited with code $? >> ${TMPFILE}
done
}
function run_wss_tests {
X=0
while [ $X -lt 1000 ]
do
X=$[$X + 1]
TMPFILE=$(mktemp --tmpdir=stress_test_results/wss)
date >> ${TMPFILE}
node node_tests/ndt_client.js --server=${SERVER} --port=3010 --protocol=wss --debug 2>&1 >> ${TMPFILE}
echo Exited with code $? >> ${TMPFILE}
done
}
function run_raw_tests {
X=0
while [ $X -lt 1000 ]
do
X=$[$X + 1]
TMPFILE=$(mktemp --tmpdir=stress_test_results/wss)
date >> ${TMPFILE}
./web100clt -n ${SERVER} -p 3001 -ddddd 2>&1 >> ${TMPFILE}
echo Exited with code $? >> ${TMPFILE}
done
}
run_ws_tests &
run_ws_tests &
run_ws_tests &
run_ws_tests &
run_ws_tests &
run_ws_tests &
run_wss_tests &
run_wss_tests &
run_wss_tests &
run_wss_tests &
run_wss_tests &
run_wss_tests &
run_raw_tests &
run_raw_tests &
run_raw_tests &
run_raw_tests &
run_raw_tests &
run_raw_tests &
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment