Skip to main content

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 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:

from django.core.wsgi import get_wsgi_application from profilelog.middleware import ProfileLogMiddleware

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.

## Caveats

If you have a compression middleware in place (for example, a gzip middleware), make sure to disable it or run it after ProfileLogMiddleware, otherwise the default profile logging function won’t be able to identify the content.

Platform: UNKNOWN

Project details


Release history Release notifications

This version
History Node

0.0.2

History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
profilelog_middleware-0.0.2-py2.py3-none-any.whl (5.2 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Mar 25, 2018
profilelog-middleware-0.0.2.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None Mar 25, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page