diff --git a/runtime/experiments/applications/run.sh b/runtime/experiments/applications/run.sh index aca91b4..440ccaf 100755 --- a/runtime/experiments/applications/run.sh +++ b/runtime/experiments/applications/run.sh @@ -1,4 +1,5 @@ #!/bin/bash +source ../common.sh # This experiment is intended to document how the level of concurrent requests influence the latency, throughput, and success/failure rate # Use -d flag if running under gdb @@ -11,36 +12,7 @@ log=log.txt mkdir -p "$results_directory" -{ - echo "*******" - echo "* Git *" - echo "*******" - git log | head -n 1 | cut -d' ' -f2 - git status - echo "" - - echo "************" - echo "* Makefile *" - echo "************" - cat ../../Makefile - echo "" - - echo "**********" - echo "* Run.sh *" - echo "**********" - cat run.sh - echo "" - - echo "************" - echo "* Hardware *" - echo "************" - lscpu - echo "" - - echo "*************" - echo "* Execution *" - echo "*************" -} >>"$results_directory/$log" +log_environment >>"$results_directory/$log" # Start the runtime if [ "$1" != "-d" ]; then @@ -50,18 +22,17 @@ else echo "Running under gdb" echo "Running under gdb" >>"$results_directory/$log" fi - payloads=(fivebyeight/5x8 handwriting/handwrt1 hyde/hyde) ports=(10000 10001 10002) iterations=1000 # Execute workloads long enough for runtime to learn excepted execution time -# echo -n "Running Samples: " -# for i in {0..2}; do -# hey -n 200 -c 3 -q 200 -o csv -m GET -D "$experiment_directory/${payloads[$i]}.pnm" "http://localhost:${ports[$i]}" -# done -# sleep 1 -# echo "[DONE]" +echo -n "Running Samples: " +for i in {0..2}; do + hey -n 200 -c 3 -q 200 -o csv -m GET -D "$experiment_directory/${payloads[$i]}.pnm" "http://localhost:${ports[$i]}" +done +sleep 1 +echo "[DONE]" # Execute the experiments echo "Running Experiments" @@ -76,10 +47,7 @@ done if [ "$1" != "-d" ]; then sleep 5 - echo -n "Running Cleanup: " - pkill sledgert >/dev/null 2>/dev/null - pkill wrk >/dev/null 2>/dev/null - echo "[DONE]" + kill_runtime fi # Generate *.csv and *.dat results @@ -137,11 +105,7 @@ for file in success latency throughput; do done # Generate gnuplots -cd "$results_directory" || exit -gnuplot ../../latency.gnuplot -gnuplot ../../success.gnuplot -gnuplot ../../throughput.gnuplot -cd "$experiment_directory" || exit +generate_gnuplots # Cleanup, if requires echo "[DONE]" diff --git a/runtime/experiments/common.sh b/runtime/experiments/common.sh new file mode 100644 index 0000000..f40f4ca --- /dev/null +++ b/runtime/experiments/common.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +log_environment() { + echo "*******" + echo "* Git *" + echo "*******" + git log | head -n 1 | cut -d' ' -f2 + git status + echo "" + + echo "************" + echo "* Makefile *" + echo "************" + cat ../../Makefile + echo "" + + echo "**********" + echo "* Run.sh *" + echo "**********" + cat run.sh + echo "" + + echo "************" + echo "* Hardware *" + echo "************" + lscpu + echo "" + + echo "*************" + echo "* Execution *" + echo "*************" +} + +kill_runtime() { + echo -n "Running Cleanup: " + pkill sledgert >/dev/null 2>/dev/null + pkill hey >/dev/null 2>/dev/null + echo "[DONE]" +} + +generate_gnuplots() { + cd "$results_directory" || exit + gnuplot ../../latency.gnuplot + gnuplot ../../success.gnuplot + gnuplot ../../throughput.gnuplot + cd "$experiment_directory" || exit +} diff --git a/runtime/experiments/concurrency/run.sh b/runtime/experiments/concurrency/run.sh index 2a2542a..65780df 100755 --- a/runtime/experiments/concurrency/run.sh +++ b/runtime/experiments/concurrency/run.sh @@ -1,4 +1,5 @@ #!/bin/bash +source ../common.sh # This experiment is intended to document how the level of concurrent requests influence the latency, throughput, and success/failure rate # Use -d flag if running under gdb @@ -11,36 +12,7 @@ log=log.txt mkdir -p "$results_directory" -{ - echo "*******" - echo "* Git *" - echo "*******" - git log | head -n 1 | cut -d' ' -f2 - git status - echo "" - - echo "************" - echo "* Makefile *" - echo "************" - cat ../../Makefile - echo "" - - echo "**********" - echo "* Run.sh *" - echo "**********" - cat run.sh - echo "" - - echo "************" - echo "* Hardware *" - echo "************" - lscpu - echo "" - - echo "*************" - echo "* Execution *" - echo "*************" -} >>"$results_directory/$log" +log_environment >>"$results_directory/$log" # Start the runtime if [ "$1" != "-d" ]; then @@ -72,10 +44,7 @@ done if [ "$1" != "-d" ]; then sleep 5 - echo -n "Running Cleanup: " - pkill sledgert >/dev/null 2>/dev/null - pkill wrk >/dev/null 2>/dev/null - echo "[DONE]" + kill_runtime fi # Generate *.csv and *.dat results @@ -132,11 +101,7 @@ for file in success latency throughput; do done # Generate gnuplots -cd "$results_directory" || exit -gnuplot ../../latency.gnuplot -gnuplot ../../success.gnuplot -gnuplot ../../throughput.gnuplot -cd "$experiment_directory" || exit +generate_gnuplots # Cleanup, if requires echo "[DONE]" diff --git a/runtime/experiments/payload/run.sh b/runtime/experiments/payload/run.sh index 8b0fe2a..edde7f6 100755 --- a/runtime/experiments/payload/run.sh +++ b/runtime/experiments/payload/run.sh @@ -1,4 +1,5 @@ #!/bin/bash +source ../common.sh # This experiment is intended to document how the level of concurrent requests influence the latency, throughput, and success/failure rate # Use -d flag if running under gdb @@ -11,36 +12,7 @@ log=log.txt mkdir -p "$results_directory" -{ - echo "*******" - echo "* Git *" - echo "*******" - git log | head -n 1 | cut -d' ' -f2 - git status - echo "" - - echo "************" - echo "* Makefile *" - echo "************" - cat ../../Makefile - echo "" - - echo "**********" - echo "* Run.sh *" - echo "**********" - cat run.sh - echo "" - - echo "************" - echo "* Hardware *" - echo "************" - lscpu - echo "" - - echo "*************" - echo "* Execution *" - echo "*************" -} >>"$results_directory/$log" +log_environment >>"$results_directory/$log" # Start the runtime if [ "$1" != "-d" ]; then @@ -88,10 +60,7 @@ done # Stop the runtime if [ "$1" != "-d" ]; then sleep 5 - echo -n "Running Cleanup: " - pkill sledgert >/dev/null 2>/dev/null - pkill wrk >/dev/null 2>/dev/null - echo "[DONE]" + kill_runtime fi # Generate *.csv and *.dat results @@ -148,11 +117,7 @@ for file in success latency throughput; do done # Generate gnuplots -cd "$results_directory" || exit -gnuplot ../../latency.gnuplot -gnuplot ../../success.gnuplot -gnuplot ../../throughput.gnuplot -cd "$experiment_directory" || exit +generate_gnuplots # Cleanup, if requires echo "[DONE]"