Moved profiler to new dev subpackage

This commit is contained in:
krateng 2022-04-09 21:20:48 +02:00
parent bceb0db09a
commit 24dfa41ad9
3 changed files with 4 additions and 3 deletions

2
maloja/dev/__init__.py Normal file
View File

@ -0,0 +1,2 @@
### Subpackage that takes care of all things that concern the server process itself,
### e.g. analytics

View File

@ -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"))

View File

@ -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
######