mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Moved profiler to new dev subpackage
This commit is contained in:
parent
bceb0db09a
commit
24dfa41ad9
2
maloja/dev/__init__.py
Normal file
2
maloja/dev/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
### Subpackage that takes care of all things that concern the server process itself,
|
||||
### e.g. analytics
|
@ -2,7 +2,6 @@ import os
|
||||
|
||||
import cProfile, pstats
|
||||
|
||||
|
||||
from doreah.logging import log
|
||||
from doreah.timing import Clock
|
||||
|
||||
@ -23,7 +22,7 @@ def profile(func):
|
||||
profiler.enable()
|
||||
result = func(*args,**kwargs)
|
||||
profiler.disable()
|
||||
|
||||
|
||||
log(f"Executed {func.__name__} ({args}, {kwargs}) in {clock.stop():.2f}s",module="debug_performance")
|
||||
try:
|
||||
pstats.Stats(profiler).dump_stats(os.path.join(benchmarkfolder,f"{func.__name__}.stats"))
|
@ -25,7 +25,7 @@ from .jinjaenv.context import jinja_environment
|
||||
from .apis import init_apis, apikeystore
|
||||
|
||||
|
||||
from .proccontrol.profiler import profile
|
||||
from .dev.profiler import profile
|
||||
|
||||
|
||||
######
|
||||
|
Loading…
Reference in New Issue
Block a user