Skip to content
Snippets Groups Projects
Commit ecff4abc authored by David Georg Reichelt's avatar David Georg Reichelt
Browse files

Extract methods for better readability

parent aa3a0c51
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ function startPrometheus { ...@@ -22,7 +22,7 @@ function startPrometheus {
rm prometheus-2.28.1.linux-amd64.tar.gz rm prometheus-2.28.1.linux-amd64.tar.gz
fi fi
cd prometheus-2.28.1.linux-amd64 cd prometheus-2.28.1.linux-amd64
./prometheus > prometheus.log & ./prometheus &> prometheus.log &
cd .. cd ..
} }
...@@ -35,7 +35,7 @@ function startJaeger { ...@@ -35,7 +35,7 @@ function startJaeger {
rm jaeger-1.24.0-linux-amd64.tar.gz rm jaeger-1.24.0-linux-amd64.tar.gz
fi fi
cd jaeger-1.24.0-linux-amd64 cd jaeger-1.24.0-linux-amd64
./jaeger-all-in-one > jaeger.log & ./jaeger-all-in-one &> jaeger.log &
cd .. cd ..
} }
...@@ -43,6 +43,107 @@ function stopBackgroundProcess { ...@@ -43,6 +43,107 @@ function stopBackgroundProcess {
kill %1 kill %1
} }
function cleanup {
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}opentelemetry.log
echo >>${BASEDIR}opentelemetry.log
sync
sleep ${SLEEPTIME}
}
function runNoInstrumentation {
# No instrumentation
k=`expr ${k} + 1`
echo " # ${i}.${j}.${k} No instrumentation"
echo " # ${i}.${j}.${k} No instrumentation" >>${BASEDIR}opentelemetry.log
${JAVABIN}java ${JAVAARGS_NOINSTR} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_uninstrumented.txt
}
function runOpenTelemetryNoLogging {
# OpenTelemetry Instrumentation Logging Deactivated
k=`expr ${k} + 1`
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Logging Deactivated"
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Logging Deactivated" >>${BASEDIR}opentelemetry.log
${JAVABIN}java ${JAVAARGS_OPENTELEMETRY_LOGGING_DEACTIVATED} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_opentelemetry.txt
}
function runOpenTelemetryLogging {
# OpenTelemetry Instrumentation Logging
k=`expr ${k} + 1`
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Logging"
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Logging" >>${BASEDIR}opentelemetry.log
${JAVABIN}java ${JAVAARGS_OPENTELEMETRY_LOGGING} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_opentelemetry_logging.txt
if [ ! "$DEBUG" = true ]
then
rm ${RESULTSDIR}output_"$i"_opentelemetry_logging.txt
fi
}
function runOpenTelemetryZipkin {
# OpenTelemetry Instrumentation Zipkin
k=`expr ${k} + 1`
startZipkin
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Zipkin"
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Zipkin" >>${BASEDIR}opentelemetry.log
${JAVABIN}java ${JAVAARGS_OPENTELEMETRY_ZIPKIN} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_opentelemetry_zipkin.txt
stopBackgroundProcess
}
function runOpenTelemetryJaeger {
# OpenTelemetry Instrumentation Jaeger
k=`expr ${k} + 1`
startJaeger
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Jaeger"
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Jaeger" >>${BASEDIR}opentelemetry.log
${JAVABIN}java ${JAVAARGS_OPENTELEMETRY_JAEGER} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_opentelemetry_prometheus.txt
stopBackgroundProcess
}
function runOpenTelemetryPrometheus {
# OpenTelemetry Instrumentation Prometheus
k=`expr ${k} + 1`
startPrometheus
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Prometheus"
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Prometheus" >>${BASEDIR}opentelemetry.log
${JAVABIN}java ${JAVAARGS_OPENTELEMETRY_PROMETHEUS} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_opentelemetry_prometheus.txt
stopBackgroundProcess
}
function getSum { function getSum {
awk '{sum += $1; square += $1^2} END {print "Average: "sum/NR" Standard Deviation: "sqrt(square / NR - (sum/NR)^2)" Count: "NR}' awk '{sum += $1; square += $1^2} END {print "Average: "sum/NR" Standard Deviation: "sqrt(square / NR - (sum/NR)^2)" Count: "NR}'
...@@ -67,8 +168,9 @@ function printIntermediaryResults { ...@@ -67,8 +168,9 @@ function printIntermediaryResults {
echo -n "Intermediary results opentelemetry Jaeger" echo -n "Intermediary results opentelemetry Jaeger"
cat tmp/results-opentelemetry/raw-*-$RECURSIONDEPTH-5.csv | awk -F';' '{print $2}' | getSum cat tmp/results-opentelemetry/raw-*-$RECURSIONDEPTH-5.csv | awk -F';' '{print $2}' | getSum
echo -n "Intermediary results opentelemetry Prometheus" # Prometheus does not work currently
cat tmp/results-opentelemetry/raw-*-$RECURSIONDEPTH-6.csv | awk -F';' '{print $2}' | getSum #echo -n "Intermediary results opentelemetry Prometheus"
#cat tmp/results-opentelemetry/raw-*-$RECURSIONDEPTH-6.csv | awk -F';' '{print $2}' | getSum
fi fi
} }
...@@ -114,7 +216,7 @@ JAR="-jar MooBench.jar" ...@@ -114,7 +216,7 @@ JAR="-jar MooBench.jar"
if [ ! -f "MooBench.jar" ] if [ ! -f "MooBench.jar" ]
then then
echo "MooBench.jar missing; please build it first using ./gradlew assemble in the main folder" echo "MooBench.jar missing; please build it first using ../gradlew assemble in the benchmark folder"
exit 1 exit 1
fi fi
...@@ -156,124 +258,27 @@ for ((i=1;i<=${NUM_LOOPS};i+=1)); do ...@@ -156,124 +258,27 @@ for ((i=1;i<=${NUM_LOOPS};i+=1)); do
echo "## Starting iteration ${i}/${NUM_LOOPS}" echo "## Starting iteration ${i}/${NUM_LOOPS}"
echo "## Starting iteration ${i}/${NUM_LOOPS}" >>${BASEDIR}opentelemetry.log echo "## Starting iteration ${i}/${NUM_LOOPS}" >>${BASEDIR}opentelemetry.log
# No instrumentation runNoInstrumentation
k=`expr ${k} + 1` cleanup
echo " # ${i}.${j}.${k} No instrumentation"
echo " # ${i}.${j}.${k} No instrumentation" >>${BASEDIR}opentelemetry.log
#sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 &
${JAVABIN}java ${JAVAARGS_NOINSTR} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_uninstrumented.txt
#kill %sar
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}opentelemetry.log
echo >>${BASEDIR}opentelemetry.log
sync
sleep ${SLEEPTIME}
# OpenTelemetry Instrumentation Logging Deactivated runOpenTelemetryNoLogging
k=`expr ${k} + 1` cleanup
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Logging Deactivated"
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Logging Deactivated" >>${BASEDIR}opentelemetry.log
#sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 &
${JAVABIN}java ${JAVAARGS_OPENTELEMETRY_LOGGING_DEACTIVATED} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_opentelemetry.txt
#kill %sar
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}opentelemetry.log
echo >>${BASEDIR}opentelemetry.log
sync
sleep ${SLEEPTIME}
# OpenTelemetry Instrumentation Logging runOpenTelemetryLogging
k=`expr ${k} + 1` cleanup
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Logging"
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Logging" >>${BASEDIR}opentelemetry.log
${JAVABIN}java ${JAVAARGS_OPENTELEMETRY_LOGGING} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_opentelemetry_logging.txt
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}opentelemetry.log
echo >>${BASEDIR}opentelemetry.log
if [ ! "$DEBUG" = true ]
then
rm ${RESULTSDIR}output_"$i"_opentelemetry_logging.txt
fi
sync
sleep ${SLEEPTIME}
# OpenTelemetry Instrumentation Zipkin runOpenTelemetryZipkin
k=`expr ${k} + 1` cleanup
startZipkin
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Zipkin"
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Zipkin" >>${BASEDIR}opentelemetry.log
${JAVABIN}java ${JAVAARGS_OPENTELEMETRY_ZIPKIN} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_opentelemetry_zipkin.txt
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}opentelemetry.log
echo >>${BASEDIR}opentelemetry.log
stopBackgroundProcess
sync
sleep ${SLEEPTIME}
MACHINE_TYPE=`uname -m`; MACHINE_TYPE=`uname -m`;
if [ ${MACHINE_TYPE} == 'x86_64' ] if [ ${MACHINE_TYPE} == 'x86_64' ]
then then
# OpenTelemetry Instrumentation Jaeger runOpenTelemetryJaeger
k=`expr ${k} + 1` cleanup
startPrometheus
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Jaeger"
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Jaeger" >>${BASEDIR}opentelemetry.log
${JAVABIN}java ${JAVAARGS_OPENTELEMETRY_JAEGER} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_opentelemetry_prometheus.txt
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}opentelemetry.log
echo >>${BASEDIR}opentelemetry.log
stopBackgroundProcess
sync
sleep ${SLEEPTIME}
# OpenTelemetry Instrumentation Prometheus # Prometheus does not work currently
k=`expr ${k} + 1` #runOpenTelemetryPrometheus
startPrometheus #cleanup
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Prometheus"
echo " # ${i}.${j}.${k} OpenTelemetry Instrumentation Prometheus" >>${BASEDIR}opentelemetry.log
${JAVABIN}java ${JAVAARGS_OPENTELEMETRY_PROMETHEUS} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--total-calls ${TOTALCALLS} \
--method-time ${METHODTIME} \
--total-threads ${THREADS} \
--recursion-depth ${j} \
${MOREPARAMS} &> ${RESULTSDIR}output_"$i"_opentelemetry_prometheus.txt
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}opentelemetry.log
echo >>${BASEDIR}opentelemetry.log
stopBackgroundProcess
sync
sleep ${SLEEPTIME}
else else
echo "No 64 Bit System; skipping Prometheus" echo "No 64 Bit System; skipping Prometheus"
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment