Skip to content

Instantly share code, notes, and snippets.

View EstevanTH's full-sized avatar

Yvon DUTAPIS EstevanTH

View GitHub Profile
@EstevanTH
EstevanTH / log_long_lasting_requests.py
Created January 12, 2024 17:23
Traces Web2py requests and logs those that last for longer than the configured threshold
# coding: UTF-8
"""Traces Web2py requests and logs those that last for longer than the configured threshold
The status of the request is displayed in the log output.
This module is very handy to identify stuck request handler threads and bottlenecks.
As of now, it has only been tested on Python 2.7.18.
Setup:
- Place this file in the "site-packages" subdirectory of Web2py.
- Create the file "routes.py" at the root of Web2py, if it does not exist.