diff --git a/frameworks/OpenTelemetry/benchmark.sh b/frameworks/OpenTelemetry/benchmark.sh index efb326ae37fcb22ff76fc5b7b612b97e7e0f45d0..4d7087395c68687019110671fc7b8e83f8afa936 100755 --- a/frameworks/OpenTelemetry/benchmark.sh +++ b/frameworks/OpenTelemetry/benchmark.sh @@ -1,154 +1,76 @@ #!/bin/bash -function startJaeger { - if [ ! -d jaeger-1.24.0-linux-amd64 ] - then - wget https://github.com/jaegertracing/jaeger/releases/download/v1.24.0/jaeger-1.24.0-linux-amd64.tar.gz - tar -xvf jaeger-1.24.0-linux-amd64.tar.gz - rm jaeger-1.24.0-linux-amd64.tar.gz - fi - cd jaeger-1.24.0-linux-amd64 - ./jaeger-all-in-one &> jaeger.log & - cd .. -} - -function cleanup { - [ -f "${BASE_DIR}/hotspot.log" ] && mv "${BASE_DIR}/hotspot.log" "${RESULTS_DIR}/hotspot-${i}-$RECURSION_DEPTH-${k}.log" - echo >> "${BASE_DIR}/OpenTelemetry.log" - echo >> "${BASE_DIR}/OpenTelemetry.log" - sync - sleep "${SLEEP_TIME}" -} - -function runNoInstrumentation { - # No instrumentation - info " # ${i}.$RECURSION_DEPTH.${k} ${TITLE[$k]}" - echo " # ${i}.$RECURSION_DEPTH.${k} ${TITLE[$k]}" >> "${BASE_DIR}/OpenTelemetry.log" - ${JAVA_BIN} ${JAVA_ARGS_NOINSTR} ${JAR} \ - --output-filename ${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv \ - --total-calls ${TOTAL_NUM_OF_CALLS} \ - --method-time ${METHOD_TIME} \ - --total-threads ${THREADS} \ - --recursion-depth $RECURSION_DEPTH \ - ${MORE_PARAMS} &> "${RESULTS_DIR}/output_${i}_${RECURSION_DEPTH}_${k}.txt" -} - -function runOpenTelemetryNoLogging { - # OpenTelemetry Instrumentation Logging Deactivated - k=`expr ${k} + 1` - info " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} - echo " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} >>${BASE_DIR}/OpenTelemetry.log - ${JAVA_BIN} ${JAVA_ARGS_OPENTELEMETRY_LOGGING_DEACTIVATED} ${JAR} \ - --output-filename "${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv" \ - --total-calls ${TOTAL_NUM_OF_CALLS} \ - --method-time ${METHOD_TIME} \ - --total-threads ${THREADS} \ - --recursion-depth ${RECURSION_DEPTH} \ - ${MORE_PARAMS} &> "${RESULTS_DIR}/output_${i}_${RECURSION_DEPTH}_${k}.txt" -} - -function runOpenTelemetryLogging { - # OpenTelemetry Instrumentation Logging - k=`expr ${k} + 1` - info " # ${i}.$RECURSION_DEPTH.${k} ${TITLE[$k]}" - echo " # ${i}.$RECURSION_DEPTH.${k} ${TITLE[$k]}" >> "${BASE_DIR}/OpenTelemetry.log" - ${JAVA_BIN} ${JAVA_ARGS_OPENTELEMETRY_LOGGING} ${JAR} \ - --output-filename ${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv \ - --total-calls ${TOTAL_NUM_OF_CALLS} \ - --method-time ${METHOD_TIME} \ - --total-threads ${THREADS} \ - --recursion-depth $RECURSION_DEPTH \ - ${MORE_PARAMS} &> ${RESULTS_DIR}/output_"$i"_"$RECURSION_DEPTH"_$k.txt - if [ ! "$DEBUG" = true ] - then - echo "DEBUG is $DEBUG, deleting opentelemetry logging file" - rm ${RESULTS_DIR}/output_"$i"_"$RECURSION_DEPTH"_$k.txt - fi -} - -function runOpenTelemetryZipkin { - # OpenTelemetry Instrumentation Zipkin - k=`expr ${k} + 1` - startZipkin - info " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} - echo " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} >>${BASE_DIR}/OpenTelemetry.log - ${JAVA_BIN} ${JAVA_ARGS_OPENTELEMETRY_ZIPKIN} ${JAR} \ - --output-filename ${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv \ - --total-calls ${TOTAL_NUM_OF_CALLS} \ - --method-time ${METHOD_TIME} \ - --total-threads ${THREADS} \ - --recursion-depth $RECURSION_DEPTH \ - ${MORE_PARAMS} &> ${RESULTS_DIR}/output_"$i"_"$RECURSION_DEPTH"_$k.txt - stopBackgroundProcess - sleep $SLEEP_TIME -} - -function runOpenTelemetryJaeger { - # OpenTelemetry Instrumentation Jaeger - k=`expr ${k} + 1` - startJaeger - info " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} - echo " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} >>${BASE_DIR}/OpenTelemetry.log - ${JAVA_BIN} ${JAVA_ARGS_OPENTELEMETRY_JAEGER} ${JAR} \ - --output-filename ${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv \ - --total-calls ${TOTAL_NUM_OF_CALLS} \ - --method-time ${METHOD_TIME} \ - --total-threads ${THREADS} \ - --recursion-depth $RECURSION_DEPTH \ - ${MORE_PARAMS} &> ${RESULTS_DIR}/output_"$i"_"$RECURSION_DEPTH"_$k.txt - stopBackgroundProcess - sleep $SLEEP_TIME -} - -function runOpenTelemetryPrometheus { - # OpenTelemetry Instrumentation Prometheus - k=`expr ${k} + 1` - startPrometheus - info " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} - echo " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} >>${BASE_DIR}/OpenTelemetry.log - ${JAVA_BIN} ${JAVA_ARGS_OPENTELEMETRY_PROMETHEUS} ${JAR} \ - --output-filename ${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv \ - --total-calls ${TOTAL_NUM_OF_CALLS} \ - --method-time ${METHOD_TIME} \ - --total-threads ${THREADS} \ - --recursion-depth $RECURSION_DEPTH \ - ${MORE_PARAMS} &> ${RESULTS_DIR}/output_"$i"_"$RECURSION_DEPTH"_$k.txt - stopBackgroundProcess - sleep $SLEEP_TIME -} - -JAVA_BIN="" - -BASE_DIR=$(pwd) -RSCRIPT_PATH="../stats.csv.r" - -source ../common-functions.sh -source labels.sh - -#MORE_PARAMS="--quickstart" -MORE_PARAMS="--application moobench.application.MonitoredClassSimple ${MORE_PARAMS}" +# +# Kieker benchmark script +# +# Usage: benchmark.sh [execute|test] + +# configure base dir +BASE_DIR=$(cd "$(dirname "$0")"; pwd) + +# +# source functionality +# + +if [ ! -d "${BASE_DIR}" ] ; then + echo "Base directory ${BASE_DIR} does not exist." + exit 1 +fi + +# load configuration and common functions +if [ -f "${BASE_DIR}/config" ] ; then + source "${BASE_DIR}/config.rc" +else + echo "Missing configuration: ${BASE_DIR}/config.rc" + exit 1 +fi + +if [ -f "${BASE_DIR}/../common-functions.sh" ] ; then + source "${BASE_DIR}/../common-functions.sh" +else + echo "Missing library: ${BASE_DIR}/../common-functions.sh" + exit 1 +fi + +if [ -f "${BASE_DIR}/functions.sh" ] ; then + source "${BASE_DIR}/functions.sh" +else + echo "Missing: ${BASE_DIR}/functions.sh" + exit 1 +fi +if [ -f "${BASE_DIR}/labels.sh" ] ; then + source "${BASE_DIR}/labels.sh" +else + echo "Missing file: ${BASE_DIR}/labels.sh" + exit 1 +fi + +# +# Setup +# + +info "----------------------------------" +info "Setup..." +info "----------------------------------" + +getAgent + +checkFile MooBench "${BASE_DIR}/MooBench.jar" +checkFile log "${BASE_DIR}/OpenTelemetry.log" clean +checkDirectory results-directory "${RESULTS_DIR}" recreate +checkExecutable java "${JAVA_BIN}" +checkFile R-script "${RSCRIPT_PATH}" + TIME=`expr ${METHOD_TIME} \* ${TOTAL_NUM_OF_CALLS} / 1000000000 \* 4 \* ${RECURSION_DEPTH} \* ${NUM_OF_LOOPS} + ${SLEEP_TIME} \* 4 \* ${NUM_OF_LOOPS} \* ${RECURSION_DEPTH} + 50 \* ${TOTAL_NUM_OF_CALLS} / 1000000000 \* 4 \* ${RECURSION_DEPTH} \* ${NUM_OF_LOOPS} ` info "Experiment will take circa ${TIME} seconds." -info "Cleaning and recreating '${RESULTS_DIR}'" -(rm -rf ${RESULTS_DIR}/**csv) && mkdir -p ${RESULTS_DIR} -#mkdir ${RESULTS_DIR}/stat/ - -# Clear OpenTelemetry.log and initialize logging -rm -f ${BASE_DIR}/OpenTelemetry.log -touch ${BASE_DIR}/OpenTelemetry.log - JAVA_ARGS="-server" JAVA_ARGS="${JAVA_ARGS} " JAVA_ARGS="${JAVA_ARGS} -Xms1G -Xmx2G" JAVA_ARGS="${JAVA_ARGS} -verbose:gc " JAR="-jar MooBench.jar" -checkMoobenchApplication - -getOpentelemetryAgent - JAVA_ARGS_NOINSTR="${JAVA_ARGS}" JAVA_ARGS_OPENTELEMETRY_BASIC="${JAVA_ARGS} -javaagent:${BASE_DIR}/lib/opentelemetry-javaagent-all.jar -Dotel.resource.attributes=service.name=moobench -Dotel.instrumentation.methods.include=moobench.application.MonitoredClassSimple[monitoredMethod];moobench.application.MonitoredClassThreaded[monitoredMethod]" JAVA_ARGS_OPENTELEMETRY_LOGGING_DEACTIVATED="${JAVA_ARGS_OPENTELEMETRY_BASIC} -Dotel.traces.exporter=logging -Dotel.traces.sampler=always_off" @@ -185,15 +107,13 @@ done # Create R labels LABELS=$(createRLabels) -run-r +runR -cleanup-results +cleanupResults -#zip -jqr ${RESULTS_DIR}/stat.zip ${RESULTS_DIR}/stat -#rm -rf ${RESULTS_DIR}/stat/ -mv ${BASE_DIR}/OpenTelemetry.log ${RESULTS_DIR}/OpenTelemetry.log -[ -f "${RESULTS_DIR}/hotspot-1-${RECURSION_DEPTH}-1.log" ] && grep "<task " ${RESULTS_DIR}/hotspot-*.log > "${RESULTS_DIR}/log.log" -[ -f "${BASE_DIR}/errorlog.txt" ] && mv "${BASE_DIR}/errorlog.txt" ${RESULTS_DIR} +mv "${BASE_DIR}/OpenTelemetry.log" "${RESULTS_DIR}/OpenTelemetry.log" +[ -f "${RESULTS_DIR}/hotspot-1-${RECURSION_DEPTH}-1.log" ] && grep "<task " "${RESULTS_DIR}/"hotspot-*.log > "${RESULTS_DIR}/OpenTelemetry.log" +[ -f "${BASE_DIR}/errorlog.txt" ] && mv "${BASE_DIR}/errorlog.txt" "${RESULTS_DIR}" # end diff --git a/frameworks/OpenTelemetry/config.rc b/frameworks/OpenTelemetry/config.rc new file mode 100644 index 0000000000000000000000000000000000000000..b702812dadc7c7cf3c78fed1a8a1aaa77d633b03 --- /dev/null +++ b/frameworks/OpenTelemetry/config.rc @@ -0,0 +1,10 @@ +# OpenTelementry configuraiton + +JAVA_BIN="/usr/bin/java" + +RSCRIPT_PATH="../stats.csv.r" + +#MORE_PARAMS="--quickstart" +MORE_PARAMS="--application moobench.application.MonitoredClassSimple ${MORE_PARAMS}" + + diff --git a/frameworks/OpenTelemetry/functions.sh b/frameworks/OpenTelemetry/functions.sh new file mode 100644 index 0000000000000000000000000000000000000000..d5a6854deeb13ec3a35bf90df0c72cbb6988edb4 --- /dev/null +++ b/frameworks/OpenTelemetry/functions.sh @@ -0,0 +1,136 @@ +# OpenTelementry specific functions + +# ensure the script is sourced +if [ "${BASH_SOURCE[0]}" -ef "$0" ] +then + echo "Hey, you should source this script, not execute it!" + exit 1 +fi + + +function getAgent() { + if [ ! -f "${BASE_DIR}/lib/opentelemetry-javaagent.jar" ] + then + mkdir -p "${BASE_DIR}/lib" + wget --output-document=${BASE_DIR}/lib/opentelemetry-javaagent.jar \ + https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar + fi +} + +function startJaeger { + if [ ! -d jaeger-1.24.0-linux-amd64 ] ; then + wget https://github.com/jaegertracing/jaeger/releases/download/v1.24.0/jaeger-1.24.0-linux-amd64.tar.gz + tar -xvf jaeger-1.24.0-linux-amd64.tar.gz + rm jaeger-1.24.0-linux-amd64.tar.gz + fi + cd jaeger-1.24.0-linux-amd64 + ./jaeger-all-in-one &> jaeger.log & + cd .. +} + +function cleanup { + [ -f "${BASE_DIR}/hotspot.log" ] && mv "${BASE_DIR}/hotspot.log" "${RESULTS_DIR}/hotspot-${i}-$RECURSION_DEPTH-${k}.log" + echo >> "${BASE_DIR}/OpenTelemetry.log" + echo >> "${BASE_DIR}/OpenTelemetry.log" + sync + sleep "${SLEEP_TIME}" +} + +function runNoInstrumentation { + # No instrumentation + info " # ${i}.$RECURSION_DEPTH.${k} ${TITLE[$k]}" + echo " # ${i}.$RECURSION_DEPTH.${k} ${TITLE[$k]}" >> "${BASE_DIR}/OpenTelemetry.log" + ${JAVA_BIN} ${JAVA_ARGS_NOINSTR} ${JAR} \ + --output-filename ${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv \ + --total-calls ${TOTAL_NUM_OF_CALLS} \ + --method-time ${METHOD_TIME} \ + --total-threads ${THREADS} \ + --recursion-depth $RECURSION_DEPTH \ + ${MORE_PARAMS} &> "${RESULTS_DIR}/output_${i}_${RECURSION_DEPTH}_${k}.txt" +} + +function runOpenTelemetryNoLogging { + # OpenTelemetry Instrumentation Logging Deactivated + k=`expr ${k} + 1` + info " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} + echo " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} >>${BASE_DIR}/OpenTelemetry.log + ${JAVA_BIN} ${JAVA_ARGS_OPENTELEMETRY_LOGGING_DEACTIVATED} ${JAR} \ + --output-filename "${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv" \ + --total-calls ${TOTAL_NUM_OF_CALLS} \ + --method-time ${METHOD_TIME} \ + --total-threads ${THREADS} \ + --recursion-depth ${RECURSION_DEPTH} \ + ${MORE_PARAMS} &> "${RESULTS_DIR}/output_${i}_${RECURSION_DEPTH}_${k}.txt" +} + +function runOpenTelemetryLogging { + # OpenTelemetry Instrumentation Logging + k=`expr ${k} + 1` + info " # ${i}.$RECURSION_DEPTH.${k} ${TITLE[$k]}" + echo " # ${i}.$RECURSION_DEPTH.${k} ${TITLE[$k]}" >> "${BASE_DIR}/OpenTelemetry.log" + ${JAVA_BIN} ${JAVA_ARGS_OPENTELEMETRY_LOGGING} ${JAR} \ + --output-filename ${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv \ + --total-calls ${TOTAL_NUM_OF_CALLS} \ + --method-time ${METHOD_TIME} \ + --total-threads ${THREADS} \ + --recursion-depth $RECURSION_DEPTH \ + ${MORE_PARAMS} &> ${RESULTS_DIR}/output_"$i"_"$RECURSION_DEPTH"_$k.txt + if [ ! "$DEBUG" = true ] + then + echo "DEBUG is $DEBUG, deleting opentelemetry logging file" + rm ${RESULTS_DIR}/output_"$i"_"$RECURSION_DEPTH"_$k.txt + fi +} + +function runOpenTelemetryZipkin { + # OpenTelemetry Instrumentation Zipkin + k=`expr ${k} + 1` + startZipkin + info " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} + echo " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} >>${BASE_DIR}/OpenTelemetry.log + ${JAVA_BIN} ${JAVA_ARGS_OPENTELEMETRY_ZIPKIN} ${JAR} \ + --output-filename ${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv \ + --total-calls ${TOTAL_NUM_OF_CALLS} \ + --method-time ${METHOD_TIME} \ + --total-threads ${THREADS} \ + --recursion-depth $RECURSION_DEPTH \ + ${MORE_PARAMS} &> ${RESULTS_DIR}/output_"$i"_"$RECURSION_DEPTH"_$k.txt + stopBackgroundProcess + sleep $SLEEP_TIME +} + +function runOpenTelemetryJaeger { + # OpenTelemetry Instrumentation Jaeger + k=`expr ${k} + 1` + startJaeger + info " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} + echo " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} >>${BASE_DIR}/OpenTelemetry.log + ${JAVA_BIN} ${JAVA_ARGS_OPENTELEMETRY_JAEGER} ${JAR} \ + --output-filename ${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv \ + --total-calls ${TOTAL_NUM_OF_CALLS} \ + --method-time ${METHOD_TIME} \ + --total-threads ${THREADS} \ + --recursion-depth $RECURSION_DEPTH \ + ${MORE_PARAMS} &> ${RESULTS_DIR}/output_"$i"_"$RECURSION_DEPTH"_$k.txt + stopBackgroundProcess + sleep $SLEEP_TIME +} + +function runOpenTelemetryPrometheus { + # OpenTelemetry Instrumentation Prometheus + k=`expr ${k} + 1` + startPrometheus + info " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} + echo " # ${i}.$RECURSION_DEPTH.${k} "${TITLE[$k]} >>${BASE_DIR}/OpenTelemetry.log + ${JAVA_BIN} ${JAVA_ARGS_OPENTELEMETRY_PROMETHEUS} ${JAR} \ + --output-filename ${RAWFN}-${i}-$RECURSION_DEPTH-${k}.csv \ + --total-calls ${TOTAL_NUM_OF_CALLS} \ + --method-time ${METHOD_TIME} \ + --total-threads ${THREADS} \ + --recursion-depth $RECURSION_DEPTH \ + ${MORE_PARAMS} &> ${RESULTS_DIR}/output_"$i"_"$RECURSION_DEPTH"_$k.txt + stopBackgroundProcess + sleep $SLEEP_TIME +} + +# end diff --git a/frameworks/OpenTelemetry/labels.sh b/frameworks/OpenTelemetry/labels.sh old mode 100755 new mode 100644 diff --git a/frameworks/common-functions.sh b/frameworks/common-functions.sh index b5cacc81e50f4c8d3e75b26941628f4cf0151886..0ddbdc5196aecb7ab615a388b75b86dc96c67743 100755 --- a/frameworks/common-functions.sh +++ b/frameworks/common-functions.sh @@ -27,15 +27,6 @@ function cleanupResults() { [ -f ${DATA_DIR}/nohup.out ] && > ${DATA_DIR}/nohup.out } -function getOpentelemetryAgent() { - if [ ! -f "${BASE_DIR}/lib/opentelemetry-javaagent.jar" ] - then - mkdir -p "${BASE_DIR}/lib" - wget --output-document=${BASE_DIR}/lib/opentelemetry-javaagent.jar \ - https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar - fi -} - function createRLabels() { # Create R labels LABELS="" diff --git a/frameworks/inspectIT/benchmark.sh b/frameworks/inspectIT/benchmark.sh index d478c4d2425f021c701d0330755c31cc5ab584b0..54e981ccc45e9fc23b8b47ec13827d48df6331f3 100755 --- a/frameworks/inspectIT/benchmark.sh +++ b/frameworks/inspectIT/benchmark.sh @@ -45,6 +45,10 @@ else exit 1 fi +# +# Setup +# + info "----------------------------------" info "Setup..." info "----------------------------------" diff --git a/frameworks/inspectIT/runExponentialSizes.sh b/frameworks/inspectIT/runExponentialSizes.sh index e24197c2faa447a01c68b0e4dff7f95c77a5ef38..f0a8fc061bb341e19ddc2883f260a5cfa987a076 100755 --- a/frameworks/inspectIT/runExponentialSizes.sh +++ b/frameworks/inspectIT/runExponentialSizes.sh @@ -31,9 +31,9 @@ cd "${BASE_DIR}" for depth in 2 4 8 16 32 64 128 do export RECURSION_DEPTH=$depth - echo "Running $depth" - ./benchmark.sh &> ${RESULTS_DIR}/$depth.txt - mv ${RESULTS_DIR}/results.zip ${RESULTS_DIR}/results-$RECURSION_DEPTH.zip + info "Running $depth" + ./benchmark.sh &> "${RESULTS_DIR}/$depth.txt" + mv "${RESULTS_DIR}/results.zip" "${RESULTS_DIR}/results-$RECURSION_DEPTH.zip" done # end