Branch: refs/heads/master
Home:
https://github.com/Checkmk/checkmk
Commit: 5afbd103ee181baee677c4931f402bf1173adf54
https://github.com/Checkmk/checkmk/commit/5afbd103ee181baee677c4931f402bf11…
Author: Christoph Rauch <christoph.rauch(a)checkmk.com>
Date: 2023-11-23 (Thu, 23 Nov 2023)
Changed paths:
M Pipfile
M Pipfile.lock
M cmk/gui/wsgi/app.py
M cmk/gui/wsgi/applications/index.wsgi
M cmk/gui/wsgi/dev_server.py
R cmk/gui/wsgi/profiling.py
A cmk/utils/profile_switcher.py
M tests/code_quality/test_pipfile.py
M tests/unit/cmk/gui/wsgi/test_profile_switcher.py
M tests/unit/cmk/gui/wsgi/test_wsgi_router.py
Log Message:
-----------
Revert "Revert "Profiling middleware: allow for profiling the application
startup phase""
Fixed issue and added another test to prevent similar
problems in the future.
This reverts the revert commit 3c4911bf0522789477b7fd3e1d5faea606dc4d8a.
Original description:
Profiling middleware: allow for profiling the application startup phase
* Introduce ProfileSwitcher middleware
* Adapt profiling tests to reflect new calling convention
* Adapt index.wsgi to use the new structure
* Remove old middleware from Flask app
* Update Pipfile: remove no longer necessary repoze.profile
middleware, make pyprof2calltree am explicit dependency.
The ProfileSwitcher middleware can now import the wrapped app
at runtime, so that importing and initialization can be profiled
as well. To achieve this, a default "config" is used for the
very first request, when no config could have been loaded yet.
For the first request, it is intentional that triggering the
profiling middleware via a "_profile" GET query-string parameter
is possible.
The subsequent requests will honor the configured profiling behavior.
CMK-14511
Change-Id: I34bf0bfcc3146bb49e85b24b6c16eba6cafce4b5