2016-09-23 11:08:40 -07:00
|
|
|
#!/usr/bin/env bash
|
2020-09-10 09:39:46 +03:00
|
|
|
|
|
|
|
set -eo pipefail
|
|
|
|
|
|
|
|
this=`basename $0`
|
|
|
|
this_dir=`dirname $0`
|
|
|
|
|
|
|
|
show_help() {
|
2016-09-23 11:08:40 -07:00
|
|
|
cat << EOF
|
2020-09-10 09:39:46 +03:00
|
|
|
Usage: $this [-a APPLICATION_NAME]
|
2016-09-23 11:08:40 -07:00
|
|
|
Aggregate the results from the specified application and plot the result.
|
|
|
|
|
|
|
|
-a APPLICATION_NAME run the pods with APPLICATION_NAME application.
|
|
|
|
APPLICATION_NAME can be one of parsec or cloverleaf.
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ $# -eq 0 ]
|
|
|
|
then
|
|
|
|
show_help
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
app="parsec"
|
|
|
|
|
|
|
|
OPTIND=1
|
|
|
|
options="ha:"
|
|
|
|
while getopts $options option
|
|
|
|
do
|
2020-09-10 09:39:46 +03:00
|
|
|
case $option in
|
2016-09-23 11:08:40 -07:00
|
|
|
a)
|
|
|
|
if [ "$OPTARG" == "parsec" ] || [ "$OPTARG" == "cloverleaf" ]
|
|
|
|
then
|
|
|
|
app=$OPTARG
|
|
|
|
else
|
|
|
|
echo "Invalid application name."
|
|
|
|
show_help
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
;;
|
2020-09-10 09:39:46 +03:00
|
|
|
h)
|
2016-09-23 11:08:40 -07:00
|
|
|
show_help
|
|
|
|
exit 0
|
|
|
|
;;
|
2020-09-10 09:39:46 +03:00
|
|
|
'?')
|
2016-09-23 11:08:40 -07:00
|
|
|
show_help
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in {1..10}
|
|
|
|
do
|
|
|
|
kubectl logs -f demo-$app-$i-wo-discovery | grep real | cut -f2 | sed -e "s/m/*60+/" -e "s/s//" | bc >> temp.log
|
|
|
|
done
|
|
|
|
paste <(cat labels-without-discovery-$app.log) <(cat temp.log) > performance.log
|
|
|
|
rm -f temp.log labels-without-discovery-$app.log
|
|
|
|
|
|
|
|
for i in {1..10}
|
|
|
|
do
|
|
|
|
kubectl logs -f demo-$app-$i-with-discovery | grep real | cut -f2 | sed -e "s/m/*60+/" -e "s/s//" | bc >> temp.log
|
|
|
|
done
|
|
|
|
paste <(cat labels-with-discovery-$app.log) <(cat temp.log) >> performance.log
|
|
|
|
rm -f temp.log labels-with-discovery-$app.log
|
|
|
|
|
|
|
|
minimum=$(awk 'min=="" || $2 < min {min=$2} END {print min}' performance.log)
|
|
|
|
awk -v min=$minimum '{print $1,((($2/min)*100))-100}' performance.log > performance-norm.log
|
2020-09-10 09:39:46 +03:00
|
|
|
"$this_dir/box-plot.R" performance.log performance-comparison-$app.pdf
|
|
|
|
"$this_dir/box-plot-norm.R" performance-norm.log performance-comparison-$app-norm.pdf
|
2016-09-23 11:08:40 -07:00
|
|
|
|
2020-09-10 09:39:46 +03:00
|
|
|
"$this_dir/clean-up.sh" -a $app
|