diff --git a/OverheadEvaluationMicrobenchmark/LICENSE b/OverheadEvaluationMicrobenchmark/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/OverheadEvaluationMicrobenchmark/MooBench/benchmark.sh b/OverheadEvaluationMicrobenchmark/MooBench/benchmark.sh new file mode 100755 index 0000000000000000000000000000000000000000..95533377527ba88bebda3e5f74d9b06e828327f2 --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/MooBench/benchmark.sh @@ -0,0 +1,251 @@ +#!/bin/bash + +# configure base dir +BASE_DIR=$(cd "$(dirname "$0")"; pwd) + +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 + . ${BASE_DIR}/config +else + echo "Missing configuration: ${BASE_DIR}/config" + exit 1 +fi +if [ -f "${BASE_DIR}/common-functions" ] ; then + . ${BASE_DIR}/common-functions +else + echo "Missing configuration: ${BASE_DIR}/common-functions" + exit 1 +fi + + +# check command line parameters +if [ "$1" == "" ] ; then + MODE="execute" +else + if [ "$1" == "execute" ] ; then + MODE="execute" + else + mode="test" + fi + OPTION="$2" +fi + +# test input parameters and configuration +checkFile R-script "${RSCRIPT_PATH}" +checkDirectory DATA_DIR "${DATA_DIR}" create + +PARENT=`dirname "${RESULTS_DIR}"` +checkDirectory result-base "$PARENT" +checkFile ApsectJ-Agent "${AGENT}" +checkFile moobench "${MOOBENCH}" + +information "----------------------------------" +information "Running benchmark..." +information "----------------------------------" + +FIXED_PARAMETERS="--quickstart -a moobench.monitoredApplication.MonitoredClassSimple" + +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} ` +information "Experiment will take circa ${TIME} seconds." + +information "Removing and recreating '$RESULTS_DIR'" +(rm -rf ${RESULTS_DIR}) && mkdir -p ${RESULTS_DIR} + +# Clear kieker.log and initialize logging +rm -f ${DATA_DIR}/kieker.log +touch ${DATA_DIR}/kieker.log + +RAWFN="${RESULTS_DIR}/raw" + +# general server arguments +JAVA_ARGS="-server" +JAVA_ARGS="${JAVA_ARGS} -d64" +JAVA_ARGS="${JAVA_ARGS} -Xms1G -Xmx4G" + +JAVA_PROGRAM="-jar ${MOOBENCH} ${FIXED_PARAMETERS}" + +LTW_ARGS="-javaagent:${AGENT} -Dorg.aspectj.weaver.showWeaveInfo=false -Daj.weaving.verbose=false -Dkieker.monitoring.skipDefaultAOPConfiguration=true -Dorg.aspectj.weaver.loadtime.configuration=${AOP}" + +KIEKER_ARGS="-Dlog4j.configuration=log4j.cfg -Dkieker.monitoring.name=KIEKER-BENCHMARK -Dkieker.monitoring.adaptiveMonitoring.enabled=false -Dkieker.monitoring.periodicSensorsExecutorPoolSize=0" + +# JAVAARGS used to configure and setup a specific writer +declare -a WRITER_CONFIG +# Receiver setup if necessary +declare -a RECEIVER +# Title +declare -a TITLE + +# Configurations +TITLE[0]="No instrumentation" +WRITER_CONFIG[0]="" + +TITLE[1]="Deactivated probe" +WRITER_CONFIG[1]="-Dkieker.monitoring.enabled=false -Dkieker.monitoring.writer=kieker.monitoring.writer.dump.DumpWriter" + +TITLE[2]="No logging (null writer)" +WRITER_CONFIG[2]="-Dkieker.monitoring.enabled=true -Dkieker.monitoring.writer=kieker.monitoring.writer.dump.DumpWriter" + +TITLE[3]="Logging (Generic Text)" +WRITER_CONFIG[3]="-Dkieker.monitoring.enabled=true -Dkieker.monitoring.writer=kieker.monitoring.writer.filesystem.FileWriter -Dkieker.monitoring.writer.filesystem.FileWriter.logStreamHandler=kieker.monitoring.writer.filesystem.TextLogStreamHandler -Dkieker.monitoring.writer.filesystem.FileWriter.customStoragePath=${DATA_DIR}/" + +TITLE[4]="Logging (Generic Bin)" +WRITER_CONFIG[4]="-Dkieker.monitoring.enabled=true -Dkieker.monitoring.writer=kieker.monitoring.writer.filesystem.FileWriter -Dkieker.monitoring.writer.filesystem.FileWriter.logStreamHandler=kieker.monitoring.writer.filesystem.BinaryLogStreamHandler -Dkieker.monitoring.writer.filesystem.FileWriter.bufferSize=8192 -Dkieker.monitoring.writer.filesystem.FileWriter.customStoragePath=${DATA_DIR}/" + +TITLE[5]="Logging (Dual TCP)" +WRITER_CONFIG[5]="-Dkieker.monitoring.writer=kieker.monitoring.writer.tcp.DualSocketTcpWriter -Dkieker.monitoring.writer.tcp.DualSocketTcpWriter.port1=2345 -Dkieker.monitoring.writer.tcp.DualSocketTcpWriter.port2=2346" +RECEIVER[5]="${BASE_DIR}/collector-2.0/bin/collector -p 2345 -p 2346" + +TITLE[6]="Logging (Single TCP)" +WRITER_CONFIG[6]="-Dkieker.monitoring.writer=kieker.monitoring.writer.tcp.SingleSocketTcpWriter -Dkieker.monitoring.writer.tcp.SingleSocketTcpWriter.port=2345" +RECEIVER[6]="${BASE_DIR}/collector-2.0/bin/collector -p 2345" + +export COLLECTOR_OPTS="-Dlog4j.configuration=file://${BASE_DIR}/log4j.cfg" + +# Create R labels +LABELS="" +for I in "${TITLE[@]}" ; do + title="$I" + if [ "$LABELS" == "" ] ; then + LABELS="\"$title\"" + else + LABELS="${LABELS}, \"$title\"" + fi +done + +## Write configuration +uname -a >${RESULTS_DIR}/configuration.txt +${JAVA_BIN} ${JAVAARGS} -version 2>>${RESULTS_DIR}/configuration.txt +cat << EOF >>${RESULTS_DIR}/configuration.txt +JAVAARGS: ${JAVAARGS} + +Runtime: circa ${TIME} seconds + +SLEEP_TIME=${SLEEP_TIME} +NUM_OF_LOOPS=${NUM_OF_LOOPS} +TOTAL_NUM_OF_CALLS=${TOTAL_NUM_OF_CALLS} +METHOD_TIME=${METHOD_TIME} +RECURSION_DEPTH=${RECURSION_DEPTH} +EOF + +sync + +################################# +# function: execute an experiment +# +# $1 = i iterator +# $2 = j iterator +# $3 = k iterator +# $4 = title +# $5 = writer parameters +function execute-experiment() { + loop="$1" + recursion="$2" + index="$3" + title="$4" + kieker_parameters="$5" + + information " # recursion=${recursion} loop=${loop} writer=${index} ${title}" + echo " # ${loop}.${recursion}.${index} ${title}" >> ${DATA_DIR}/kieker.log + + if [ "${kieker_parameters}" = "" ] ; then + COMPLETE_ARGS=${JAVA_ARGS} + else + COMPLETE_ARGS="${JAVA_ARGS} ${LTW_ARGS} ${KIEKER_ARGS} ${kieker_parameters}" + fi + + ${JAVA_BIN} ${COMPLETE_ARGS} ${JAVA_PROGRAM} \ + --output-filename ${RAWFN}-${loop}-${recursion}-${index}.csv \ + --total-calls ${TOTAL_NUM_OF_CALLS} \ + --method-time ${METHOD_TIME} \ + --total-threads 1 \ + --recursion-depth ${recursion} + + rm -rf ${DATA_DIR}/kieker-* + + [ -f ${DATA_DIR}/hotspot.log ] && mv ${DATA_DIR}/hotspot.log ${RESULTS_DIR}hotspot-${loop}-${recursion}-${index}.log + echo >> ${DATA_DIR}/kieker.log + echo >> ${DATA_DIR}/kieker.log + sync + sleep ${SLEEP_TIME} +} + +function execute-benchmark-body() { + index="$1" + loop="$2" + recursion="$3" + if [[ ${RECEIVER[$index]} ]] ; then + echo "receiver ${RECEIVER[$index]}" + ${RECEIVER[$index]} & #>> ${DATA_DIR}/kieker.receiver-$i-$index.log & + RECEIVER_PID=$! + fi + + execute-experiment "$loop" "$recursion" "$index" "${TITLE[$index]}" "${WRITER_CONFIG[$index]}" + + if [[ $RECEIVER_PID ]] ; then + wait $RECEIVER_PID + unset RECEIVER_PID + fi +} + +## Execute Benchmark +function execute-benchmark() { + for ((loop=1;loop<=${NUM_OF_LOOPS};loop+=1)); do + recursion=${RECURSION_DEPTH} + + information "## Starting iteration ${i}/${NUM_OF_LOOPS}" + echo "## Starting iteration ${i}/${NUM_OF_LOOPS}" >>${DATA_DIR}/kieker.log + + for ((index=0;index<${#WRITER_CONFIG[@]};index+=1)); do + execute-benchmark-body $index $loop $recursion + done + done + + mv ${DATA_DIR}/kieker.log ${RESULTS_DIR}/kieker.log + [ -f ${RESULTS_DIR}/hotspot-1-${RECURSION_DEPTH}-1.log ] && grep "<task " ${RESULTS_DIR}/hotspot-*.log > ${RESULTS_DIR}/log.log + [ -f ${DATA_DIR}/errorlog.txt ] && mv ${DATA_DIR}/errorlog.txt ${RESULTS_DIR} +} + +## Generate Results file +function run-r() { +R --vanilla --silent << EOF +results_fn="${RAWFN}" +outtxt_fn="${RESULTS_DIR}/results-text.txt" +outcsv_fn="${RESULTS_DIR}/results-text.csv" +configs.loop=${NUM_OF_LOOPS} +configs.recursion=${RECURSION_DEPTH} +configs.labels=c($LABELS) +results.count=${TOTAL_NUM_OF_CALLS} +results.skip=${TOTAL_NUM_OF_CALLS}/2 +source("${RSCRIPT_PATH}") +EOF +} + +## Clean up raw results +function cleanup-results() { + zip -jqr ${RESULTS_DIR}/results.zip ${RAWFN}* + rm -f ${RAWFN}* + [ -f ${DATA_DIR}/nohup.out ] && cp ${DATA_DIR}/nohup.out ${RESULTS_DIR} + [ -f ${DATA_DIR}/nohup.out ] && > ${DATA_DIR}/nohup.out +} + +## Execute benchmark +if [ "$MODE" == "execute" ] ; then + if [ "$OPTION" == "" ] ; then + execute-benchmark + else + execute-benchmark-body $OPTION 1 1 + fi + run-r + cleanup-results +else + execute-benchmark-body $OPTION 1 1 +fi + +information "Done." + +# end diff --git a/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/bin/collector b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/bin/collector new file mode 100755 index 0000000000000000000000000000000000000000..2d6e5aeda1b757b3b519569a964c6f515e3e42c4 --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/bin/collector @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## collector start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/.." >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="collector" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and COLLECTOR_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/lib/collector-2.0.jar:$APP_HOME/lib/jcommander-1.72.jar:$APP_HOME/lib/slf4j-log4j12-1.7.25.jar:$APP_HOME/lib/slf4j-api-1.7.25.jar:$APP_HOME/lib/log4j-1.2.17.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $COLLECTOR_OPTS -classpath "\"$CLASSPATH\"" experiment.TCPReceiverMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/bin/collector.bat b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/bin/collector.bat new file mode 100755 index 0000000000000000000000000000000000000000..5da030a1b50bf5d0cbcefb215d7313ad60a0e2f1 --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/bin/collector.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem collector startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME%.. + +@rem Add default JVM options here. You can also use JAVA_OPTS and COLLECTOR_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\lib\collector-2.0.jar;%APP_HOME%\lib\jcommander-1.72.jar;%APP_HOME%\lib\slf4j-log4j12-1.7.25.jar;%APP_HOME%\lib\slf4j-api-1.7.25.jar;%APP_HOME%\lib\log4j-1.2.17.jar + +@rem Execute collector +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %COLLECTOR_OPTS% -classpath "%CLASSPATH%" experiment.TCPReceiverMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable COLLECTOR_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%COLLECTOR_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/collector-2.0.jar b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/collector-2.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..12b4a4271629fb57edad55ad2f4cbaf79a81dd71 Binary files /dev/null and b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/collector-2.0.jar differ diff --git a/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/jcommander-1.72.jar b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/jcommander-1.72.jar new file mode 100644 index 0000000000000000000000000000000000000000..acb8e609b15cc2bf6142171c1bb4ddd2868483c6 Binary files /dev/null and b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/jcommander-1.72.jar differ diff --git a/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/log4j-1.2.17.jar b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/log4j-1.2.17.jar new file mode 100644 index 0000000000000000000000000000000000000000..1d425cf7d7e25f81be64d32c406ff66cfb6c4766 Binary files /dev/null and b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/log4j-1.2.17.jar differ diff --git a/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/slf4j-api-1.7.25.jar b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/slf4j-api-1.7.25.jar new file mode 100644 index 0000000000000000000000000000000000000000..0143c099699ee843cde6d95c9dbc7751039d2463 Binary files /dev/null and b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/slf4j-api-1.7.25.jar differ diff --git a/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/slf4j-log4j12-1.7.25.jar b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/slf4j-log4j12-1.7.25.jar new file mode 100644 index 0000000000000000000000000000000000000000..7d88a6e75bcee54464e70f57a595cab677ce77fc Binary files /dev/null and b/OverheadEvaluationMicrobenchmark/MooBench/collector-2.0/lib/slf4j-log4j12-1.7.25.jar differ diff --git a/OverheadEvaluationMicrobenchmark/MooBench/common-functions b/OverheadEvaluationMicrobenchmark/MooBench/common-functions new file mode 100644 index 0000000000000000000000000000000000000000..3d5d389abf4c2f62186f9b7a6abbe9c31398780f --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/MooBench/common-functions @@ -0,0 +1,62 @@ +export RED='\033[1;31m' +export WHITE='\033[1;37m' +export YELLOW='\033[1;33m' +export NC='\033[0m' + +export ERROR="${RED}[error]${NC}" +export WARNING="${YELLOW}[warning]${NC}" +export INFO="${WHITE}[info]${NC}" + + +function error() { + echo -e "${ERROR} $@" +} + +function warning() { + echo -e "${WARNING} $@" +} + +function information() { + echo -e "${INFO} $@" +} + +# $1 = NAME, $2 = EXECUTABLE +function checkExecutable() { + if [ "$2" == "" ] ; then + error "$1 variable for executable not set." + exit 1 + fi + if [ ! -x "$2" ] ; then + error "$1 not found at: $2" + exit 1 + fi +} + +# $1 = NAME, $2 = FILE +function checkFile() { + if [ "$2" == "" ] ; then + error "$1 variable for file not set." + exit 1 + fi + if [ ! -f "$2" ] ; then + error "$1 not found at: $2" + exit 1 + fi +} + +# $1 = NAME, $2 = FILE +function checkDirectory() { + if [ "$2" == "" ] ; then + error "$1 directory variable not set." + exit 1 + fi + if [ ! -d "$2" ] ; then + if [ "$3" == "create" ] ; then + information "$1: directory does not exist, creating it" + else + error "$1: directory $2 does not exist." + exit 1 + fi + fi +} + diff --git a/OverheadEvaluationMicrobenchmark/MooBench/config b/OverheadEvaluationMicrobenchmark/MooBench/config new file mode 100644 index 0000000000000000000000000000000000000000..9d0cf7bc0c8d52f8ef64b1fa0365e621bbaa3504 --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/MooBench/config @@ -0,0 +1,24 @@ +## +# MooBench configuration parameter + +# path setup +JAVA_BIN="java" + +RSCRIPT_PATH="${BASE_DIR}/r/stats.csv.r" + +DATA_DIR="${BASE_DIR}/data" +RESULTS_DIR="${BASE_DIR}/results-kieker" +AGENT="${BASE_DIR}/lib/kieker-1.15-SNAPSHOT-aspectj.jar" +MOOBENCH="${BASE_DIR}/moobench-2.0-all.jar" + +# in-jar locations +AOP="kieker.aop.xml" + +# execution parameter +SLEEP_TIME=30 ## 30 +NUM_OF_LOOPS=10 ## 10 +RECURSION_DEPTH=10 ## 10 +TOTAL_NUM_OF_CALLS=2000000 ## 2 000 000 +METHOD_TIME=500 ## 500000 + +# end diff --git a/OverheadEvaluationMicrobenchmark/MooBench/lib/.gitignore b/OverheadEvaluationMicrobenchmark/MooBench/lib/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5e7d2734cfc60289debf74293817c0a8f572ff32 --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/MooBench/lib/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/OverheadEvaluationMicrobenchmark/MooBench/log4j.cfg b/OverheadEvaluationMicrobenchmark/MooBench/log4j.cfg new file mode 100644 index 0000000000000000000000000000000000000000..abb7ab0738e43ca47b15df352906d9b883c5ee17 --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/MooBench/log4j.cfg @@ -0,0 +1,10 @@ +# Root logger option +log4j.rootLogger=INFO, stdout +log4j.rootLogger=ERROR, stdout +#log4j.rootLogger=DEBUG, stdout + +# Direct log messages to stdout +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n diff --git a/OverheadEvaluationMicrobenchmark/MooBench/moobench-2.0-all.jar b/OverheadEvaluationMicrobenchmark/MooBench/moobench-2.0-all.jar new file mode 100644 index 0000000000000000000000000000000000000000..02bc5205a4a6e3fac3bed94efd89757e085002ba Binary files /dev/null and b/OverheadEvaluationMicrobenchmark/MooBench/moobench-2.0-all.jar differ diff --git a/OverheadEvaluationMicrobenchmark/MooBench/r/stats.csv.r b/OverheadEvaluationMicrobenchmark/MooBench/r/stats.csv.r new file mode 100644 index 0000000000000000000000000000000000000000..7d3e21f069b0da249d2581c2f5272886d5ff3caa --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/MooBench/r/stats.csv.r @@ -0,0 +1,107 @@ +############################################ +# R - script to collect all moobench results +############################################ + +# these values are here only as documentation. The parameters are set by benchmark.sh +#rm(list=ls(all=TRUE)) +#data_fn="data/" +#folder_fn="results-benchmark-binary" +#results_fn=paste(data_fn,folder_fn,"/raw",sep="") +#outtxt_fn=paste(data_fn,folder_fn,"/results-text.txt",sep="") +#results_fn="raw" +#outtxt_fn="results-text.txt" + +######### +# These are configuration parameters which are automatically prepended to this file by the benchmark.sh script. +# Therefore, they must not be set here. The following lines only serve as documentation. +#configs.loop=10 +#configs.recursion=c(10) +#configs.labels=c("No Probe","Inactive Probe","Collecting Data","Writing Data (ASCII)", "Writing Data (Bin)") +#results.count=2000000 +#results.skip=1000000 + +#bars.minval=500 +#bars.maxval=600 + + +########## +# Process configuration + +# divisor 1 = nano, 1000 = micro, 1000000 = milli seconds +timeUnit <- 1000 + +# number of Kieker writer configurations +numberOfWriters <- length(configs.labels) +recursion_depth <- configs.recursion + +numberOfValues <- configs.loop*(results.count-results.skip) +numbers <- c(1:(numberOfValues)) +resultDimensionNames <- list(configs.labels, numbers) + +# result values +resultsBIG <- array(dim=c(numberOfWriters, numberOfValues), dimnames=resultDimensionNames) + +########## +# Create result + +## "[ recursion , config , loop ]" + +numOfRowsToRead <- results.count-results.skip + +for (writer_idx in (1:numberOfWriters)) { + recordsPerSecond = c() + rpsLastDuration = 0 + rpsCount = 0 + file_idx <- writer_idx - 1 + + # loop + for (loop_counter in (1:configs.loop)) { + results_fn_filepath <- paste(results_fn, "-", loop_counter, "-", recursion_depth, "-", file_idx, ".csv", sep="") + message(results_fn_filepath) + results <- read.csv2(results_fn_filepath, nrows=numOfRowsToRead, skip=results.skip, quote="", colClasses=c("NULL","numeric", "numeric", "numeric"), comment.char="", col.names=c("thread_id", "duration_nsec", "gc", "t"), header=FALSE) + trx_idx <- c(1:numOfRowsToRead) + resultsBIG[writer_idx,trx_idx] <- results[["duration_nsec"]] + } +} + +qnorm_value <- qnorm(0.975) + +# print results +printDimensionNames <- list(c("mean","ci95%","md25%","md50%","md75%","max","min"), c(1:numberOfWriters)) +# row number == number of computed result values, e.g., mean, min, max +printvalues <- matrix(nrow=7, ncol=numberOfWriters, dimnames=printDimensionNames) + +for (writer_idx in (1:numberOfWriters)) { + idx_mult <- c(1:numOfRowsToRead) + + valuesBIG <- resultsBIG[writer_idx,idx_mult]/timeUnit + + printvalues["mean",writer_idx] <- mean(valuesBIG) + printvalues["ci95%",writer_idx] <- qnorm_value*sd(valuesBIG)/sqrt(length(valuesBIG)) + printvalues[c("md25%","md50%","md75%"),writer_idx] <- quantile(valuesBIG, probs=c(0.25, 0.5, 0.75)) + printvalues["max",writer_idx] <- max(valuesBIG) + printvalues["min",writer_idx] <- min(valuesBIG) +} +resultstext <- formatC(printvalues,format="f",digits=4,width=8) + +print(resultstext) + +write(paste("Recursion Depth: ", recursion_depth),file=outtxt_fn,append=TRUE) +write("response time",file=outtxt_fn,append=TRUE) +write.table(resultstext,file=outtxt_fn,append=TRUE,quote=FALSE,sep="\t",col.names=FALSE) + +concResult <- "" +headResult <- "" +# write the first n-1 elements preceded by a comma (,) +for (writer_idx in (1:(numberOfWriters-1))) { + headResult <- paste(headResult, configs.labels[writer_idx], ",") + concResult <- paste(concResult, printvalues["mean",writer_idx], ",") +} +# write the last without a comma +headResult <- paste(headResult, configs.labels[numberOfWriters]) +concResult <- paste(concResult, printvalues["mean", numberOfWriters]) + +write(headResult,file=outcsv_fn,append=TRUE) +write(concResult,file=outcsv_fn,append=TRUE) + +# end diff --git a/OverheadEvaluationMicrobenchmark/README b/OverheadEvaluationMicrobenchmark/README new file mode 100644 index 0000000000000000000000000000000000000000..25c23afd3c0d383ccc930f269f581948e43d0fb6 --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/README @@ -0,0 +1,9 @@ +MooBench http://kieker-monitoring.net/MooBench +----------------------------------------------- + +The Overhead Evaluation Microbenchmark moved to its own git repository: + + http://git.kieker-monitoring.net/moobench.git + +This directory contains a pre-compiled version of MooBench and the necessary scripts to start the benchmark of Kieker from Jenkins. + diff --git a/OverheadEvaluationMicrobenchmark/executeRemoteMicroBenchmark.sh b/OverheadEvaluationMicrobenchmark/executeRemoteMicroBenchmark.sh new file mode 100755 index 0000000000000000000000000000000000000000..9cb3a928ae6fb416edf80759f8193b5427932240 --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/executeRemoteMicroBenchmark.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +BASE_DIR=$(dirname $0) + +if [ "$1" == "" ] ; then + echo "Error: No computation node specified." + exit 1 +fi + +# The following constant specifies user name and address of the remote node executing the benchmark. +# We recommend to use SSH keys for the access and to install Java (>= 1.6) and R (> 3.0) on the remote node. +REMOTE_NODE="$1" + +# The following constant specifies location and name of the benchmarked jar file relative to the workspace. +BENCHMARKED_JAR=build/libs/kieker-1.15-SNAPSHOT-aspectj.jar + +# The following constants specify location and name of the MooBench folder +MOOBENCH_FOLDER=${BASE_DIR}/MooBench + +# The following constant specifies the name of the folder containing the results from MooBench +RESULTS_FOLDER_NAME=results-kieker + +# This constant specifies the target file for the results +RESULTS_TARGET_FILE=plot.csv + +# Copy the benchmarked file and MooBench to the remote node +scp -r ${MOOBENCH_FOLDER} ${REMOTE_NODE}:MooBench +# fix for KIEKER-1559: create empty folders "data" and "lib" +ssh ${REMOTE_NODE} 'mkdir -p MooBench/data; mkdir -p MooBench/lib; exit' +scp ${BENCHMARKED_JAR} ${REMOTE_NODE}:MooBench/lib + +# Execute MooBench +ssh ${REMOTE_NODE} 'cd MooBench; chmod +x benchmark.sh; ./benchmark.sh; exit' + +# Copy results to workspace +scp ${REMOTE_NODE}:MooBench/${RESULTS_FOLDER_NAME}/results-text.csv ${RESULTS_TARGET_FILE} + +# Save up to 100 results from previous benchmarks on the remote node and clean up +BACKUP_FOLDER_NAME="$(date +%Y-%m-%d-%H-%M-%S)" +ssh ${REMOTE_NODE} "mkdir old-results/${BACKUP_FOLDER_NAME}; cp MooBench/${RESULTS_FOLDER_NAME}/results.zip old-results/${BACKUP_FOLDER_NAME}/; exit" +# A Non-Solaris OS could require "-d '\n'" for the xargs command +ssh ${REMOTE_NODE} "cd old-results; ls -A1t | sed -e '1,100d' | xargs rm -rf; exit" +ssh ${REMOTE_NODE} 'rm -rf MooBench; exit' diff --git a/OverheadEvaluationMicrobenchmark/rerun-benchmark.sh b/OverheadEvaluationMicrobenchmark/rerun-benchmark.sh new file mode 100755 index 0000000000000000000000000000000000000000..e74d7f79a8bf2d1f7bf28f5e94a5a66e9662ff3c --- /dev/null +++ b/OverheadEvaluationMicrobenchmark/rerun-benchmark.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +BASE_DIR=$(cd "$(dirname "$0")"; pwd) + +NUM_OF_REPEATS=100 +export RESULT_FILE="${BASE_DIR}/MooBench/results-kieker/results-text.csv" +COLLECTED_DATA_FILE="${BASE_DIR}/results.csv" +BENCHMARK="${BASE_DIR}/MooBench/benchmark.sh" +#BENCHMARK="${BASE_DIR}/ex.sh" + +rm -f ${COLLECTED_DATA_FILE} + +for ((v=1;v<=${NUM_OF_REPEATS};v+=1)); do + echo "++++++++++++++++++++++++++" + echo "Rerun $v" + echo "++++++++++++++++++++++++++" + ${BENCHMARK} # > /dev/null 2>&1 + HEAD=`head -1 $RESULT_FILE` + VALUE=`tail -1 $RESULT_FILE` + if [ -f "${COLLECTED_DATA_FILE}" ] ; then + echo "$VALUE" >> ${COLLECTED_DATA_FILE} + else + echo "$HEAD" > ${COLLECTED_DATA_FILE} + echo "$VALUE" >> ${COLLECTED_DATA_FILE} + fi +done + +# end +