Skip to main content

WSGI middleware for line-by-line profiling

Project description

PyPI version PyPI Supported Python Versions Build Status AppVeyor Build Status Documentation Status

wsgi_lineprof is a WSGI middleware for line-by-line profiling.

wsgi_lineprof has the following features:

  • WSGI middleware: It can be integrated with any WSGI-compatible applications and frameworks including Django, Pyramid, Flask, Bottle, and more.
  • Easily pluggable: All configurations for profiling in one place. Users don’t need to make any changes to their application.

wsgi_lineprof is not recommended to be used in production environment because of the overhead of profiling.

At a Glance

You can use wsgi_lineprof as a WSGI middleware of existing applications.

$ pip install wsgi_lineprof

Apply wsgi_lineprof to the existing WSGI web application:

from wsgi_lineprof.middleware import LineProfilerMiddleware
app = LineProfilerMiddleware(app)

Start the web application and access to the application. wsgi_lineprof writes results to stdout every time an HTTP request is processed by default. You can see the output like this in your console:

... (snip) ...

File: ./
Name: index
Total time: 1.00518 [sec]
  Line      Hits         Time  Code
     9                         @app.route('/')
    10                         def index():
    11         1      1005175      time.sleep(1)
    12         1            4      return "Hello world!!"

... (snip) ...

Please check the documentation for more details.

Download files

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

Files for wsgi-lineprof, version 0.8.0
Filename, size & hash File type Python version Upload date
wsgi_lineprof-0.8.0-cp27-cp27m-macosx_10_14_x86_64.macosx_10_13_x86_64.macosx_10_12_x86_64.macosx_10_11_x86_64.macosx_10_10_x86_64.whl (37.0 kB) View hashes Wheel cp27
wsgi_lineprof-0.8.0-cp27-cp27m-manylinux1_i686.whl (103.2 kB) View hashes Wheel cp27
wsgi_lineprof-0.8.0-cp27-cp27m-manylinux1_x86_64.whl (111.6 kB) View hashes Wheel cp27
wsgi_lineprof-0.8.0-cp27-cp27mu-manylinux1_i686.whl (103.3 kB) View hashes Wheel cp27
wsgi_lineprof-0.8.0-cp27-cp27mu-manylinux1_x86_64.whl (111.6 kB) View hashes Wheel cp27
wsgi_lineprof-0.8.0-cp35-cp35m-macosx_10_13_x86_64.macosx_10_14_x86_64.macosx_10_12_x86_64.macosx_10_11_x86_64.macosx_10_10_x86_64.whl (37.4 kB) View hashes Wheel cp35
wsgi_lineprof-0.8.0-cp35-cp35m-manylinux1_i686.whl (114.0 kB) View hashes Wheel cp35
wsgi_lineprof-0.8.0-cp35-cp35m-manylinux1_x86_64.whl (123.6 kB) View hashes Wheel cp35
wsgi_lineprof-0.8.0-cp35-cp35m-win32.macosx_10_14_x86_64.macosx_10_13_x86_64.macosx_10_12_x86_64.macosx_10_11_x86_64.macosx_10_10_x86_64.whl (34.0 kB) View hashes Wheel cp35
wsgi_lineprof-0.8.0-cp35-cp35m-win_amd64.macosx_10_14_x86_64.macosx_10_13_x86_64.macosx_10_12_x86_64.macosx_10_11_x86_64.macosx_10_10_x86_64.whl (38.0 kB) View hashes Wheel cp35
wsgi_lineprof-0.8.0-cp36-cp36m-macosx_10_13_x86_64.macosx_10_14_x86_64.macosx_10_12_x86_64.macosx_10_11_x86_64.macosx_10_10_x86_64.whl (38.0 kB) View hashes Wheel cp36
wsgi_lineprof-0.8.0-cp36-cp36m-manylinux1_i686.whl (116.6 kB) View hashes Wheel cp36
wsgi_lineprof-0.8.0-cp36-cp36m-manylinux1_x86_64.whl (126.0 kB) View hashes Wheel cp36
wsgi_lineprof-0.8.0-cp36-cp36m-win32.macosx_10_14_x86_64.macosx_10_13_x86_64.macosx_10_12_x86_64.macosx_10_11_x86_64.macosx_10_10_x86_64.whl (34.3 kB) View hashes Wheel cp36
wsgi_lineprof-0.8.0-cp36-cp36m-win_amd64.macosx_10_14_x86_64.macosx_10_13_x86_64.macosx_10_12_x86_64.macosx_10_11_x86_64.macosx_10_10_x86_64.whl (38.5 kB) View hashes Wheel cp36
wsgi_lineprof-0.8.0-cp37-cp37m-macosx_10_14_x86_64.macosx_10_13_x86_64.macosx_10_12_x86_64.macosx_10_11_x86_64.macosx_10_10_x86_64.whl (37.9 kB) View hashes Wheel cp37
wsgi_lineprof-0.8.0-cp37-cp37m-manylinux1_i686.whl (116.6 kB) View hashes Wheel cp37
wsgi_lineprof-0.8.0-cp37-cp37m-manylinux1_x86_64.whl (125.8 kB) View hashes Wheel cp37
wsgi_lineprof-0.8.0-cp37-cp37m-win32.macosx_10_14_x86_64.macosx_10_13_x86_64.macosx_10_12_x86_64.macosx_10_11_x86_64.macosx_10_10_x86_64.whl (34.3 kB) View hashes Wheel cp37
wsgi_lineprof-0.8.0-cp37-cp37m-win_amd64.macosx_10_14_x86_64.macosx_10_13_x86_64.macosx_10_12_x86_64.macosx_10_11_x86_64.macosx_10_10_x86_64.whl (38.4 kB) View hashes Wheel cp37
wsgi_lineprof-0.8.0.tar.gz (54.3 kB) View hashes Source None

Supported by

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