WSGI middleware for logging profiling data.
Project description
Provides profiling results through console.log. Home-page: https://github.com/chromano/profilelog Maintainer: Carlos H. Romano Maintainer-email: chromano@gmail.com License: UNKNOWN Description: # ProfileLogMiddleware
This is a WSGI middleware which will profile the request and embed it in the response. The default behavior is to embed the profiling data via console.table, right before the closing <html> tag. The result is that you can then see the information by opening devtools (should work on both Chrome and Firefox):
![](https://github.com/chromano/profilelog-middleware/blob/master/sample.png “Chrome devtools”)
## Installation
pip install -e git+https://github.com/chromano/profilelog-middleware.git#egg=profilelog-middleware
## Usage
Simply wrap your WSGI application with profilelog.middleware.ProfileLogMiddleware. Below is an example for the wsgi.py file provided with Django projects:
import os
from django.core.wsgi import get_wsgi_application from profilelog.middleware import ProfileLogMiddleware
os.environ.setdefault(“DJANGO_SETTINGS_MODULE”, “project.settings”)
application = ProfileLogMiddleware(get_wsgi_application())
## Config
You can specify to the middleware how far you want to go by specifying the number of function calls to display. Example:
application = ProfileLogMiddleware(get_wsgi_application(), limit=5)
The default value for limit is 25, which should suffice for most usecases.
Platform: UNKNOWN
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for profilelog-middleware-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8161a5e2bab2c1687c403b68e7239e883217534f2f97f81c48e298fdc8da5eb8 |
|
MD5 | a29bea58b1d2391f1114485e3e80a382 |
|
BLAKE2b-256 | 1a05d7be648c7ff7cae439c7c1ec1e1701de355774147420154127765d5343f4 |
Hashes for profilelog_middleware-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0db0adc859e440b946bc23aa1bc93adb09c583d8d13595ac41a5349327a34e64 |
|
MD5 | 2ce788ed28321731058f5f0bfcce5cd9 |
|
BLAKE2b-256 | 186ba163123cd067b5c2ce39ebc20a7830744f962bcbd1f53f6c4fc63b412f51 |