diff --git a/frameworks/Kieker/python/.spyproject/config/backups/codestyle.ini.bak b/frameworks/Kieker/python/.spyproject/config/backups/codestyle.ini.bak new file mode 100644 index 0000000000000000000000000000000000000000..0f54b4c43608018a7326818dec70b1bcc553bc66 --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/backups/codestyle.ini.bak @@ -0,0 +1,8 @@ +[codestyle] +indentation = True +edge_line = True +edge_line_columns = 79 + +[main] +version = 0.2.0 + diff --git a/frameworks/Kieker/python/.spyproject/config/backups/encoding.ini.bak b/frameworks/Kieker/python/.spyproject/config/backups/encoding.ini.bak new file mode 100644 index 0000000000000000000000000000000000000000..a17acedd726ca82a69c584c98d0bf649af3b20d6 --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/backups/encoding.ini.bak @@ -0,0 +1,6 @@ +[encoding] +text_encoding = utf-8 + +[main] +version = 0.2.0 + diff --git a/frameworks/Kieker/python/.spyproject/config/backups/vcs.ini.bak b/frameworks/Kieker/python/.spyproject/config/backups/vcs.ini.bak new file mode 100644 index 0000000000000000000000000000000000000000..fd66eae017a103d4e26f0ce25355ab7cc0534b8d --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/backups/vcs.ini.bak @@ -0,0 +1,7 @@ +[vcs] +use_version_control = False +version_control_system = + +[main] +version = 0.2.0 + diff --git a/frameworks/Kieker/python/.spyproject/config/backups/workspace.ini.bak b/frameworks/Kieker/python/.spyproject/config/backups/workspace.ini.bak new file mode 100644 index 0000000000000000000000000000000000000000..9a0e84fbc2d73ed669b7e3120cb95353f8f73b33 --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/backups/workspace.ini.bak @@ -0,0 +1,12 @@ +[workspace] +restore_data_on_startup = True +save_data_on_exit = True +save_history = True +save_non_project_files = False +project_type = 'empty-project-type' +recent_files = ['main.py', 'config.ini', 'todo.md', 'moo.py'] + +[main] +version = 0.2.0 +recent_files = [] + diff --git a/frameworks/Kieker/python/.spyproject/config/codestyle.ini b/frameworks/Kieker/python/.spyproject/config/codestyle.ini new file mode 100644 index 0000000000000000000000000000000000000000..0f54b4c43608018a7326818dec70b1bcc553bc66 --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/codestyle.ini @@ -0,0 +1,8 @@ +[codestyle] +indentation = True +edge_line = True +edge_line_columns = 79 + +[main] +version = 0.2.0 + diff --git a/frameworks/Kieker/python/.spyproject/config/defaults/defaults-codestyle-0.2.0.ini b/frameworks/Kieker/python/.spyproject/config/defaults/defaults-codestyle-0.2.0.ini new file mode 100644 index 0000000000000000000000000000000000000000..0b95e5cee73129de3449c878d8dda2853ed86ee4 --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/defaults/defaults-codestyle-0.2.0.ini @@ -0,0 +1,5 @@ +[codestyle] +indentation = True +edge_line = True +edge_line_columns = 79 + diff --git a/frameworks/Kieker/python/.spyproject/config/defaults/defaults-encoding-0.2.0.ini b/frameworks/Kieker/python/.spyproject/config/defaults/defaults-encoding-0.2.0.ini new file mode 100644 index 0000000000000000000000000000000000000000..0ce193c1e31fea3975f234a934bb07918b05d738 --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/defaults/defaults-encoding-0.2.0.ini @@ -0,0 +1,3 @@ +[encoding] +text_encoding = utf-8 + diff --git a/frameworks/Kieker/python/.spyproject/config/defaults/defaults-vcs-0.2.0.ini b/frameworks/Kieker/python/.spyproject/config/defaults/defaults-vcs-0.2.0.ini new file mode 100644 index 0000000000000000000000000000000000000000..ee2548333213981054a3a42dbc3e0a033746b25f --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/defaults/defaults-vcs-0.2.0.ini @@ -0,0 +1,4 @@ +[vcs] +use_version_control = False +version_control_system = + diff --git a/frameworks/Kieker/python/.spyproject/config/defaults/defaults-workspace-0.2.0.ini b/frameworks/Kieker/python/.spyproject/config/defaults/defaults-workspace-0.2.0.ini new file mode 100644 index 0000000000000000000000000000000000000000..2a73ab7ad0a908810de32981505f94e2b8724c38 --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/defaults/defaults-workspace-0.2.0.ini @@ -0,0 +1,6 @@ +[workspace] +restore_data_on_startup = True +save_data_on_exit = True +save_history = True +save_non_project_files = False + diff --git a/frameworks/Kieker/python/.spyproject/config/encoding.ini b/frameworks/Kieker/python/.spyproject/config/encoding.ini new file mode 100644 index 0000000000000000000000000000000000000000..a17acedd726ca82a69c584c98d0bf649af3b20d6 --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/encoding.ini @@ -0,0 +1,6 @@ +[encoding] +text_encoding = utf-8 + +[main] +version = 0.2.0 + diff --git a/frameworks/Kieker/python/.spyproject/config/vcs.ini b/frameworks/Kieker/python/.spyproject/config/vcs.ini new file mode 100644 index 0000000000000000000000000000000000000000..fd66eae017a103d4e26f0ce25355ab7cc0534b8d --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/vcs.ini @@ -0,0 +1,7 @@ +[vcs] +use_version_control = False +version_control_system = + +[main] +version = 0.2.0 + diff --git a/frameworks/Kieker/python/.spyproject/config/workspace.ini b/frameworks/Kieker/python/.spyproject/config/workspace.ini new file mode 100644 index 0000000000000000000000000000000000000000..9a0e84fbc2d73ed669b7e3120cb95353f8f73b33 --- /dev/null +++ b/frameworks/Kieker/python/.spyproject/config/workspace.ini @@ -0,0 +1,12 @@ +[workspace] +restore_data_on_startup = True +save_data_on_exit = True +save_history = True +save_non_project_files = False +project_type = 'empty-project-type' +recent_files = ['main.py', 'config.ini', 'todo.md', 'moo.py'] + +[main] +version = 0.2.0 +recent_files = [] + diff --git a/frameworks/Kieker/python/__pycache__/moo.cpython-39.pyc b/frameworks/Kieker/python/__pycache__/moo.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b5fa0c01a661419af9b8f9f041f6035d1771720 Binary files /dev/null and b/frameworks/Kieker/python/__pycache__/moo.cpython-39.pyc differ diff --git a/frameworks/Kieker/python/config.ini b/frameworks/Kieker/python/config.ini new file mode 100644 index 0000000000000000000000000000000000000000..b2b79b509ff1bc35cae9b4d2b9804431f483fa1f --- /dev/null +++ b/frameworks/Kieker/python/config.ini @@ -0,0 +1,9 @@ +[Benchmark] +total_calls = 100000 +recursion_depth = 10 +method_time = 500000 +config_path = /home/serafim/Desktop/kieker-experiment/monitoring.ini +inactive = False +instrumentation_on = True +approach = 1 + diff --git a/frameworks/Kieker/python/main.py b/frameworks/Kieker/python/main.py index 94394216b89d0005df6cd6c938f812015bd13e5f..31ec864847bd685cd4aac4004f91361c3b021b71 100644 --- a/frameworks/Kieker/python/main.py +++ b/frameworks/Kieker/python/main.py @@ -2,25 +2,63 @@ # standard import import sys import time +import configparser +import re # instrumentation -import tools.aspect + # read argumetns -total_calls =int(sys.argv[1]) -recursion_depth = int(sys.argv[2]) -method_time = int(sys.argv[3]) -ini_path = sys.argv[4] +if len(sys.argv) < 2: + print('Path to the benchmark configuration file was not provided.') + + + +parser = configparser.ConfigParser() +parser.read(sys.argv[1]) +total_calls =int(parser.get('Benchmark','total_calls')) +recursion_depth = int(parser.get('Benchmark','recursion_depth')) +method_time = int(parser.get('Benchmark','method_time')) +ini_path = parser.get('Benchmark','config_path') +inactive = parser.getboolean('Benchmark', 'inactive') +instrumentation_on = parser.getboolean('Benchmark', 'instrumentation_on') +approach = parser.getint('Benchmark', 'approach') +print(f"total_cals = {total_calls}") +print(f"recurison_depth = {recursion_depth}") +print(f"method_time = {method_time}") # instrument from monitoring.controller import SingleMonitoringController from tools.importhookast import InstrumentOnImportFinder +from tools.importhook import PostImportFinder ex =[] #sys.path.append("/home/serafim/Desktop/moo") some_var = SingleMonitoringController(ini_path) -sys.meta_path.insert(0, InstrumentOnImportFinder(ignore_list=ex, debug_on=True)) +if instrumentation_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") + + sys.meta_path.insert(0, InstrumentOnImportFinder(ignore_list=ex, empty=inactive, debug_on=True)) + 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') + exclude_modules = list() + sys.meta_path.insert(0, PostImportFinder(pattern_object, exclude_modules, empty = inactive)) +else: + print('Instrumentation is off') import moo -print(moo.__dict__) + + + start_ns = 0 stop_ns = 0