adding app_cprofile

This commit is contained in:
Cayo Puigdefabregas 2021-12-01 13:44:24 +01:00
parent efa2ae9a92
commit 9df81c2fad
1 changed files with 9 additions and 0 deletions

9
examples/app_cprofile.py Normal file
View File

@ -0,0 +1,9 @@
from ereuse_devicehub.devicehub import Devicehub
from werkzeug.contrib.profiler import ProfilerMiddleware
app = Devicehub(inventory='dbtest')
app.config["SQLALCHEMY_RECORD_QUERIES"] = True
app.config['PROFILE'] = True
app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30])
app.run(debug = True)