chore: DRY up scripts

main
Sean McBride 4 years ago
parent b0f20d62fc
commit 0a08453f29

@ -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]"

@ -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
}

@ -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]"

@ -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]"

Loading…
Cancel
Save