Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moobench
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SustainKieker
moobench
Commits
7b224904
Commit
7b224904
authored
2 years ago
by
silvergl
Browse files
Options
Downloads
Patches
Plain Diff
python benchmark implementation started
parent
21ee2084
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frameworks/Kieker/python/main.py
+35
-0
35 additions, 0 deletions
frameworks/Kieker/python/main.py
frameworks/Kieker/python/moo.py
+14
-0
14 additions, 0 deletions
frameworks/Kieker/python/moo.py
with
49 additions
and
0 deletions
frameworks/Kieker/python/main.py
0 → 100644
+
35
−
0
View file @
7b224904
# -*- coding: utf-8 -*-
# standard import
import
sys
import
time
# 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
]
# instrument
from
monitoring.controller
import
SingleMonitoringController
from
tools.importhookast
import
InstrumentOnImportFinder
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
))
import
moo
print
(
moo
.
__dict__
)
start_ns
=
0
stop_ns
=
0
timings
=
[]
for
i
in
range
(
total_calls
):
start_ns
=
time
.
time_ns
()
moo
.
monitored_method
(
method_time
,
recursion_depth
)
stop_ns
=
time
.
time_ns
()
timings
.
append
(
stop_ns
-
start_ns
)
if
i
%
100000
==
0
:
print
(
timings
[
-
1
])
This diff is collapsed.
Click to expand it.
frameworks/Kieker/python/moo.py
0 → 100644
+
14
−
0
View file @
7b224904
# -*- coding: utf-8 -*-
import
time
def
monitored_method
(
method_time
,
rec_depth
):
if
rec_depth
>
1
:
return
monitored_method
(
method_time
,
rec_depth
-
1
)
else
:
exit_time
=
time
.
time_ns
()
+
method_time
current_time
=
0
while
True
:
current_time
=
time
.
time_ns
()
if
current_time
<
exit_time
:
break
return
current_time
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment