From 9df81c2fadb1799a94465f929da012a159a761d3 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 1 Dec 2021 13:44:24 +0100 Subject: [PATCH] adding app_cprofile --- examples/app_cprofile.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 examples/app_cprofile.py diff --git a/examples/app_cprofile.py b/examples/app_cprofile.py new file mode 100644 index 00000000..e9f7d3fd --- /dev/null +++ b/examples/app_cprofile.py @@ -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)