chore: DRY up scripts

main
Sean McBride 4 years ago
parent 99d33c46cb
commit 6377185276

@ -1,4 +1,5 @@
#!/bin/bash #!/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 # 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 # Use -d flag if running under gdb
@ -11,36 +12,7 @@ log=log.txt
mkdir -p "$results_directory" mkdir -p "$results_directory"
{ log_environment >>"$results_directory/$log"
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"
# Start the runtime # Start the runtime
if [ "$1" != "-d" ]; then if [ "$1" != "-d" ]; then
@ -50,18 +22,17 @@ else
echo "Running under gdb" echo "Running under gdb"
echo "Running under gdb" >>"$results_directory/$log" echo "Running under gdb" >>"$results_directory/$log"
fi fi
payloads=(fivebyeight/5x8 handwriting/handwrt1 hyde/hyde) payloads=(fivebyeight/5x8 handwriting/handwrt1 hyde/hyde)
ports=(10000 10001 10002) ports=(10000 10001 10002)
iterations=1000 iterations=1000
# Execute workloads long enough for runtime to learn excepted execution time # Execute workloads long enough for runtime to learn excepted execution time
# echo -n "Running Samples: " echo -n "Running Samples: "
# for i in {0..2}; do 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]}" hey -n 200 -c 3 -q 200 -o csv -m GET -D "$experiment_directory/${payloads[$i]}.pnm" "http://localhost:${ports[$i]}"
# done done
# sleep 1 sleep 1
# echo "[DONE]" echo "[DONE]"
# Execute the experiments # Execute the experiments
echo "Running Experiments" echo "Running Experiments"
@ -76,10 +47,7 @@ done
if [ "$1" != "-d" ]; then if [ "$1" != "-d" ]; then
sleep 5 sleep 5
echo -n "Running Cleanup: " kill_runtime
pkill sledgert >/dev/null 2>/dev/null
pkill wrk >/dev/null 2>/dev/null
echo "[DONE]"
fi fi
# Generate *.csv and *.dat results # Generate *.csv and *.dat results
@ -137,11 +105,7 @@ for file in success latency throughput; do
done done
# Generate gnuplots # Generate gnuplots
cd "$results_directory" || exit generate_gnuplots
gnuplot ../../latency.gnuplot
gnuplot ../../success.gnuplot
gnuplot ../../throughput.gnuplot
cd "$experiment_directory" || exit
# Cleanup, if requires # Cleanup, if requires
echo "[DONE]" 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 #!/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 # 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 # Use -d flag if running under gdb
@ -11,36 +12,7 @@ log=log.txt
mkdir -p "$results_directory" mkdir -p "$results_directory"
{ log_environment >>"$results_directory/$log"
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"
# Start the runtime # Start the runtime
if [ "$1" != "-d" ]; then if [ "$1" != "-d" ]; then
@ -72,10 +44,7 @@ done
if [ "$1" != "-d" ]; then if [ "$1" != "-d" ]; then
sleep 5 sleep 5
echo -n "Running Cleanup: " kill_runtime
pkill sledgert >/dev/null 2>/dev/null
pkill wrk >/dev/null 2>/dev/null
echo "[DONE]"
fi fi
# Generate *.csv and *.dat results # Generate *.csv and *.dat results
@ -132,11 +101,7 @@ for file in success latency throughput; do
done done
# Generate gnuplots # Generate gnuplots
cd "$results_directory" || exit generate_gnuplots
gnuplot ../../latency.gnuplot
gnuplot ../../success.gnuplot
gnuplot ../../throughput.gnuplot
cd "$experiment_directory" || exit
# Cleanup, if requires # Cleanup, if requires
echo "[DONE]" echo "[DONE]"

@ -1,4 +1,5 @@
#!/bin/bash #!/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 # 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 # Use -d flag if running under gdb
@ -11,36 +12,7 @@ log=log.txt
mkdir -p "$results_directory" mkdir -p "$results_directory"
{ log_environment >>"$results_directory/$log"
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"
# Start the runtime # Start the runtime
if [ "$1" != "-d" ]; then if [ "$1" != "-d" ]; then
@ -88,10 +60,7 @@ done
# Stop the runtime # Stop the runtime
if [ "$1" != "-d" ]; then if [ "$1" != "-d" ]; then
sleep 5 sleep 5
echo -n "Running Cleanup: " kill_runtime
pkill sledgert >/dev/null 2>/dev/null
pkill wrk >/dev/null 2>/dev/null
echo "[DONE]"
fi fi
# Generate *.csv and *.dat results # Generate *.csv and *.dat results
@ -148,11 +117,7 @@ for file in success latency throughput; do
done done
# Generate gnuplots # Generate gnuplots
cd "$results_directory" || exit generate_gnuplots
gnuplot ../../latency.gnuplot
gnuplot ../../success.gnuplot
gnuplot ../../throughput.gnuplot
cd "$experiment_directory" || exit
# Cleanup, if requires # Cleanup, if requires
echo "[DONE]" echo "[DONE]"

Loading…
Cancel
Save