diff options
author | drebs <drebs@riseup.net> | 2018-01-05 09:37:26 -0200 |
---|---|---|
committer | drebs <drebs@riseup.net> | 2018-01-05 09:37:26 -0200 |
commit | 7a2960d78baa00ef21da4e54c037a3f8cd78ccfc (patch) | |
tree | 8ac9e9b1b9b591365446ee00225323716c4232cb /blob-multiprocess/run-test.sh | |
parent | dde6cc729b2a32fc0201e9a124827e4bd7e6ca99 (diff) |
Fix directory name.
Diffstat (limited to 'blob-multiprocess/run-test.sh')
-rwxr-xr-x | blob-multiprocess/run-test.sh | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/blob-multiprocess/run-test.sh b/blob-multiprocess/run-test.sh deleted file mode 100755 index eab6aaa..0000000 --- a/blob-multiprocess/run-test.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -# Run Multiprocessing Test -# ======================== -# - -# This script measures the time of several interactions with the Blobs Server -# and outputs them to a text file. -# -# The different test scenarios are: -# - 1, 2, 4, and 8 server processes. -# - several client actions (baseline, list, put, get, flag, delete) -# - -# -# Client actions -# -------------- - -# Baseline: is a GET / to a dummy server that returns an empty reply. Nothing -# can be faster than this. - -# List: is a GET /blobs/username, which lists the (empty) set of blobs stored -# in the server. - -set -e - - -kill_multiproc() { - pids=$(ps aux | grep python | grep "\(multiproc\|blobs-server\)" \ - | grep -v grep | sed -e "s/\s\+/ /g" | cut -d' ' -f 2) - if [ ! -z "${pids}" ]; then - for pid in ${pids}; do - kill -9 ${pid} - done - fi -} - - -start_multiproc() { - procs=${1} - kill_multiproc - make multiproc PROCS=${procs} > /dev/null & - sleep 3 - make roundrobin PROCS=${procs} - sleep 1 -} - - -get_best() { - statement=$* - result=$(python -m timeit -n 1 -r 5 -s "import os" "os.system('${statement}')") - best=$(echo $result | sed -e s/.\*best\ of\ 5:\ // -e s/per\ loop//) - echo $best -} - - -get_mean() { - statement=$* - python -c "import timeit; t = timeit.timeit('import os; os.system(\'./${statement} > /dev/null\');', number=5); print t / 5" -} - - -request() { - action=${1} - procs=${2} - amount=${3} - size=${4} - best=$(get_mean ./request.py --${action} ${amount} ${size}) - echo "${procs} ${action} ${amount} ${size} ${best}" -} - - -run_test() { - for procs in 1 2 4 8; do - start_multiproc ${procs} - for action in baseline list put get flag delete; do - #for amountsize in "10 1000" "100 100" "1000 10"; do - for amountsize in "1000 10"; do - rm -rf /tmp/blobs/* - request ${action} ${procs} ${amountsize} >> results.txt - done - done - kill_multiproc - done -} - -run_test |