Skip to content
Snippets Groups Projects
Commit 4bc4bfef authored by Reiner Jung's avatar Reiner Jung
Browse files

Updated python benchmark

parent b525e04c
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,7 @@ pipeline {
stage('Run Benchmark') {
steps {
sh './frameworks/Kieker/python/benchmark.sh'
sh './frameworks/Kieker/java/benchmark.sh'
sh './frameworks/OpenTelemetry/benchmark.sh'
sh './frameworks/inspectIT/benchmark.sh'
......
......@@ -44,21 +44,6 @@ else
echo "Missing file: ${BASE_DIR}/labels.sh"
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
#
# Setup
#
......@@ -72,24 +57,23 @@ cd "${BASE_DIR}"
# load agent
getAgent
checkDirectory data-dir "${DATA_DIR}" create
checkDirectory results-directory "${RESULTS_DIR}" recreate
PARENT=`dirname "${RESULTS_DIR}"`
checkDirectory result-base "${PARENT}"
# Find receiver and extract it
checkFile receiver "${RECEIVER_ARCHIVE}"
tar -xpf "${RECEIVER_ARCHIVE}"
RECEIVER_BIN="${BASE_DIR}/receiver/bin/receiver"
checkExecutable receiver "${RECEIVER_BIN}"
PARENT=`dirname "${RESULTS_DIR}"`
checkDirectory DATA_DIR "${DATA_DIR}" create
checkDirectory result-base "${PARENT}"
checkFile ApsectJ-Agent "${AGENT}"
checkExecutable Receiver "${RECEIVER_BIN}"
checkFile Labels "${BASE_DIR}/labels.sh"
checkFile R-script "${RSCRIPT_PATH}"
checkDirectory results-directory "${RESULTS_DIR}" recreate
checkFile log "${DATA_DIR}/kieker.log" clean
checkExecutable java "${JAVA_BIN}"
checkExecutable moobench "${MOOBENCH_BIN}"
checkExecutable receiver "${RECEIVER_BIN}"
checkFile aop-file "${AOP}"
showParameter
......@@ -153,20 +137,12 @@ info "----------------------------------"
info "Running benchmark..."
info "----------------------------------"
if [ "$MODE" == "execute" ] ; then
if [ "$OPTION" == "" ] ; then
executeBenchmark
else
executeBenchmarkBody $OPTION 1 1
fi
# Create R labels
LABELS=$(createRLabels)
runStatistics
cleanupResults
else
executeBenchmarkBody $OPTION 1 1
fi
executeBenchmark
# Create R labels
LABELS=$(createRLabels)
runStatistics
cleanupResults
info "Done."
......
......@@ -10,8 +10,6 @@ import re
if len(sys.argv) < 2:
print('Path to the benchmark configuration file was not provided.')
parser = configparser.ConfigParser()
parser.read(sys.argv[1])
......@@ -22,10 +20,12 @@ ini_path = parser.get('Benchmark','config_path')
inactive = parser.getboolean('Benchmark', 'inactive')
instrumentation_on = parser.getboolean('Benchmark', 'instrumentation_on')
approach = parser.getint('Benchmark', 'approach')
output_filename = parser.get('Benchmark', 'output_filename')
print(f"total_calls = {total_calls}")
print(f"recurison_depth = {recursion_depth}")
print(f"method_time = {method_time}")
# debug
#print(f"total_calls = {total_calls}")
#print(f"recurison_depth = {recursion_depth}")
#print(f"method_time = {method_time}")
# instrument
from monitoring.controller import SingleMonitoringController
......@@ -34,39 +34,50 @@ from tools.importhook import PostImportFinder
ex =[]
some_var = SingleMonitoringController(ini_path)
if instrumentation_on:
print ('Instrumentation is on.')
# print ('Instrumentation is on.')
if approach == 2:
print("2nd instrumentation approach is chosen")
if not inactive:
print("Instrumentation is activated")
else:
print("Instrumentation is not activated")
# print("2nd instrumentation approach is chosen")
#if not inactive:
#print("Instrumentation is activated")
#else:
# print("Instrumentation is not activated")
sys.meta_path.insert(0, InstrumentOnImportFinder(ignore_list=ex, empty=inactive, debug_on=True))
sys.meta_path.insert(0, InstrumentOnImportFinder(ignore_list=ex, empty=inactive, debug_on=False))
else:
print("1st instrumentation approach is chosen")
if not inactive:
print("Instrumentation is activated")
else:
print("Instrumentation is not activated")
pattern_object = re.compile('moo')
#print("1st instrumentation approach is chosen")
#if not inactive:
# print("Instrumentation is activated")
#else:
# print("Instrumentation is not activated")
pattern_object = re.compile('monitored_application')
exclude_modules = list()
sys.meta_path.insert(0, PostImportFinder(pattern_object, exclude_modules, empty = inactive))
else:
print('Instrumentation is off')
import monitored_application
#else:
# print('Instrumentation is off')
import monitored_application
# setup
output_file = open(output_filename, "w")
thread_id = 0
start_ns = 0
stop_ns = 0
timings = []
# run experiment
for i in range(total_calls):
start_ns = time.time_ns()
monitored_application.monitored_method(method_time, recursion_depth)
stop_ns = time.time_ns()
timings.append(stop_ns-start_ns)
if i%100000 ==0:
if i%100000 == 0:
print(timings[-1])
output_file.write(f"{thread_id};{timings[-1]}\n")
output_file.close()
# end
......@@ -76,8 +76,6 @@ showParameter
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."
# JAVA_ARGS used to configure and setup a specific writer
declare -a WRITER_CONFIG
# Receiver setup if necessary
declare -a RECEIVER
# Title
......@@ -115,7 +113,10 @@ info "----------------------------------"
executeBenchmark
# cleanup
# Create R labels
LABELS=$(createRLabels)
runStatistics
cleanupResults
info "Done."
......
......@@ -47,6 +47,7 @@ config_path = ${BASE_DIR}/monitoring.ini
inactive = $inactive
instrumentation_on = $instrument
approach = $approach
output_filename = ${RAWFN}-${loop}-${RECURSION_DEPTH}-${index}.csv
EOF
}
......@@ -77,7 +78,6 @@ function noInstrumentation() {
"${PYTHON}" benchmark.py "${BASE_DIR}/config.ini" # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt"
echo >> "${DATA_DIR}/kieker.log"
echo >> "${DATA_DIR}/kieker.log"
sync
......@@ -178,13 +178,13 @@ function executeBenchmark() {
noInstrumentation 0 $loop
dactivatedProbe 1 $loop 1
dactivatedProbe 1 $loop 2
noLogging 2 $loop 1
noLogging 2 $loop 2
textLogging 3 $loop 1
textLogging 3 $loop 2
tcpLogging 4 $loop 1
tcpLogging 4 $loop 2
dactivatedProbe 2 $loop 2
noLogging 3 $loop 1
noLogging 4 $loop 2
textLogging 5 $loop 1
textLogging 6 $loop 2
tcpLogging 7 $loop 1
tcpLogging 8 $loop 2
printIntermediaryResults
done
......
TITLE[0]="No instrumentation"
TITLE[1]="Deactivated probe"
TITLE[2]="No logging (null writer)"
TITLE[3]="Logging (Generic Text)"
TITLE[4]="Logging (TCP)"
TITLE[1]="Deactivated probe - A"
TITLE[2]="Deactivated probe - B"
TITLE[3]="No logging (null writer) - A"
TITLE[4]="No logging (null writer) - B"
TITLE[5]="Logging (Generic Text) - A"
TITLE[6]="Logging (Generic Text) - B"
TITLE[7]="Logging (TCP) - A"
TITLE[8]="Logging (TCP) - B"
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