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

Updated Kieker python benchmark

parent 2af805f2
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ inactive = parser.getboolean('Benchmark', 'inactive') ...@@ -23,7 +23,7 @@ inactive = parser.getboolean('Benchmark', 'inactive')
instrumentation_on = parser.getboolean('Benchmark', 'instrumentation_on') instrumentation_on = parser.getboolean('Benchmark', 'instrumentation_on')
approach = parser.getint('Benchmark', 'approach') approach = parser.getint('Benchmark', 'approach')
print(f"total_cals = {total_calls}") print(f"total_calls = {total_calls}")
print(f"recurison_depth = {recursion_depth}") print(f"recurison_depth = {recursion_depth}")
print(f"method_time = {method_time}") print(f"method_time = {method_time}")
...@@ -32,7 +32,6 @@ from monitoring.controller import SingleMonitoringController ...@@ -32,7 +32,6 @@ from monitoring.controller import SingleMonitoringController
from tools.importhookast import InstrumentOnImportFinder from tools.importhookast import InstrumentOnImportFinder
from tools.importhook import PostImportFinder from tools.importhook import PostImportFinder
ex =[] ex =[]
#sys.path.append("/home/serafim/Desktop/moo")
some_var = SingleMonitoringController(ini_path) some_var = SingleMonitoringController(ini_path)
if instrumentation_on: if instrumentation_on:
print ('Instrumentation is on.') print ('Instrumentation is on.')
......
...@@ -113,7 +113,7 @@ info "----------------------------------" ...@@ -113,7 +113,7 @@ info "----------------------------------"
info "Running benchmark..." info "Running benchmark..."
info "----------------------------------" info "----------------------------------"
benchmark executeBenchmark
# cleanup # cleanup
......
...@@ -11,13 +11,19 @@ fi ...@@ -11,13 +11,19 @@ fi
function getAgent() { function getAgent() {
info "Setup Kieker4Python" info "Setup Kieker4Python"
checkExecutable python "${PYHTON}" checkExecutable python "${PYTHON}"
checkExecutable pip "${PIP}" checkExecutable pip "${PIP}"
checkExecutbale git "${GIT}" checkExecutable git "${GIT}"
# note: if it already exists
if [ -d "${KIEKER_4_PYTHON_DIR}" ] ; then
rm -rf "${KIEKER_4_PYTHON_DIR}"
fi
"${GIT}" clone "${KIEKER_4_PYTHON_REPO_URL}" "${GIT}" clone "${KIEKER_4_PYTHON_REPO_URL}"
checkDirectory kieker-python "${KIEKER_4_PYTHON_DIR}" checkDirectory kieker-python "${KIEKER_4_PYTHON_DIR}"
cd "${KIEKER_4_PYTHON_DIR}" cd "${KIEKER_4_PYTHON_DIR}"
"${GIT}" checkout "${KIEKER_4_PYTHON_BRANCH}"
"${PYTHON}" -m build "${PYTHON}" -m build
"${PIP}" install dist/kieker-monitoring-for-python-0.0.1.tar.gz "${PIP}" install dist/kieker-monitoring-for-python-0.0.1.tar.gz
cd "${BASE_DIR}" cd "${BASE_DIR}"
...@@ -32,7 +38,7 @@ function createConfig() { ...@@ -32,7 +38,7 @@ function createConfig() {
inactive="$1" inactive="$1"
instrument="$2" instrument="$2"
approach="$3" approach="$3"
cat > config.ini << EOF cat > "${BASE_DIR}/config.ini" << EOF
[Benchmark] [Benchmark]
total_calls = ${TOTAL_NUM_OF_CALLS} total_calls = ${TOTAL_NUM_OF_CALLS}
recursion_depth = ${RECURSION_DEPTH} recursion_depth = ${RECURSION_DEPTH}
...@@ -40,13 +46,13 @@ method_time = ${METHOD_TIME} ...@@ -40,13 +46,13 @@ method_time = ${METHOD_TIME}
config_path = ${BASE_DIR}/monitoring.ini config_path = ${BASE_DIR}/monitoring.ini
inactive = $inactive inactive = $inactive
instrumentation_on = $instrument instrumentation_on = $instrument
approach = $appraoch approach = $approach
EOF EOF
} }
function createMonitoring() { function createMonitoring() {
mode="$1" mode="$1"
cat > monitoring.ini << EOF cat > "${BASE_DIR}/monitoring.ini" << EOF
[Main] [Main]
mode = ${mode} mode = ${mode}
...@@ -56,7 +62,7 @@ port = 5678 ...@@ -56,7 +62,7 @@ port = 5678
connection_timeout = 10 connection_timeout = 10
[FileWriter] [FileWriter]
file_path = ${DATA_DIR} file_path = ${DATA_DIR}/kieker
EOF EOF
} }
...@@ -69,9 +75,8 @@ function noInstrumentation() { ...@@ -69,9 +75,8 @@ function noInstrumentation() {
createConfig True False 1 createConfig True False 1
"${PYTHON}" benchmark.py # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt" "${PYTHON}" benchmark.py "${BASE_DIR}/config.ini" # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt"
rm -rf "${DATA_DIR}"/kieker-*
echo >> "${DATA_DIR}/kieker.log" echo >> "${DATA_DIR}/kieker.log"
echo >> "${DATA_DIR}/kieker.log" echo >> "${DATA_DIR}/kieker.log"
...@@ -90,9 +95,8 @@ function dactivatedProbe() { ...@@ -90,9 +95,8 @@ function dactivatedProbe() {
createMonitoring dummy createMonitoring dummy
createConfig True True ${approach} createConfig True True ${approach}
"${PYTHON}" benchmark.py # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt" "${PYTHON}" benchmark.py "${BASE_DIR}/config.ini" # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt"
rm -rf "${DATA_DIR}"/kieker-*
echo >> "${DATA_DIR}/kieker.log" echo >> "${DATA_DIR}/kieker.log"
echo >> "${DATA_DIR}/kieker.log" echo >> "${DATA_DIR}/kieker.log"
...@@ -111,9 +115,8 @@ function noLogging() { ...@@ -111,9 +115,8 @@ function noLogging() {
createMonitoring dummy createMonitoring dummy
createConfig False True ${approach} createConfig False True ${approach}
"${PYTHON}" benchmark.py # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt" "${PYTHON}" benchmark.py "${BASE_DIR}/config.ini" # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt"
rm -rf "${DATA_DIR}"/kieker-*
echo >> "${DATA_DIR}/kieker.log" echo >> "${DATA_DIR}/kieker.log"
echo >> "${DATA_DIR}/kieker.log" echo >> "${DATA_DIR}/kieker.log"
...@@ -132,9 +135,8 @@ function textLogging() { ...@@ -132,9 +135,8 @@ function textLogging() {
createMonitoring text createMonitoring text
createConfig False True ${approach} createConfig False True ${approach}
"${PYTHON}" benchmark.py # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt" "${PYTHON}" benchmark.py "${BASE_DIR}/config.ini" # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt"
rm -rf "${DATA_DIR}"/kieker-*
echo >> "${DATA_DIR}/kieker.log" echo >> "${DATA_DIR}/kieker.log"
echo >> "${DATA_DIR}/kieker.log" echo >> "${DATA_DIR}/kieker.log"
...@@ -150,12 +152,17 @@ function tcpLogging() { ...@@ -150,12 +152,17 @@ function tcpLogging() {
info " # ${loop}.${RECURSION_DEPTH}.${index} ${TITLE[index]}" info " # ${loop}.${RECURSION_DEPTH}.${index} ${TITLE[index]}"
echo " # ${loop}.${RECURSION_DEPTH}.${index} ${TITLE[index]}" >> "${DATA_DIR}/kieker.log" echo " # ${loop}.${RECURSION_DEPTH}.${index} ${TITLE[index]}" >> "${DATA_DIR}/kieker.log"
${RECEIVER_BIN} 5678 &
RECEIVER_PID=$!
echo $RECEIVER_PID
sleep "${SLEEP_TIME}"
createMonitoring tcp createMonitoring tcp
createConfig False True ${approach} createConfig False True ${approach}
"${PYTHON}" benchmark.py # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt" "${PYTHON}" benchmark.py "${BASE_DIR}/config.ini" # &> "${RESULTS_DIR}/output_${loop}_${RECURSION_DEPTH}_${index}.txt"
rm -rf "${DATA_DIR}"/kieker-* kill -9 $RECEIVER_PID
echo >> "${DATA_DIR}/kieker.log" echo >> "${DATA_DIR}/kieker.log"
echo >> "${DATA_DIR}/kieker.log" echo >> "${DATA_DIR}/kieker.log"
...@@ -170,8 +177,8 @@ function executeBenchmark() { ...@@ -170,8 +177,8 @@ function executeBenchmark() {
echo "## Starting iteration ${loop}/${NUM_OF_LOOPS}" >> "${DATA_DIR}/kieker.log" echo "## Starting iteration ${loop}/${NUM_OF_LOOPS}" >> "${DATA_DIR}/kieker.log"
noInstrumentation 0 $loop noInstrumentation 0 $loop
dactivatedProbe 1 $loop dactivatedProbe 1 $loop 1
dactivatedProbe 2 $loop dactivatedProbe 1 $loop 2
noLogging 2 $loop 1 noLogging 2 $loop 1
noLogging 2 $loop 2 noLogging 2 $loop 2
textLogging 3 $loop 1 textLogging 3 $loop 1
......
...@@ -9,6 +9,6 @@ def monitored_method(method_time, rec_depth): ...@@ -9,6 +9,6 @@ def monitored_method(method_time, rec_depth):
while True: while True:
current_time = time.time_ns() current_time = time.time_ns()
if current_time< exit_time: if current_time > exit_time:
break break
return current_time return current_time
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment