Skip to main content

WSGI middleware for line-by-line profiling

Project description

PyPI version PyPI Supported Python Versions GitHub Actions (Tests) 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 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: ./app.py
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) ...

Also, you can check the result on your web browser by accessing the special endpoint /wsgi_lineprof/.

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.14.0
Filename, size File type Python version Upload date Hashes
Filename, size wsgi_lineprof-0.14.0-cp310-cp310-macosx_10_14_x86_64.macosx_10_10_x86_64.whl (42.9 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.manylinux_2_24_i686.whl (178.7 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (181.8 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl (215.1 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (223.4 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp310-cp310-win32.whl (40.8 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp310-cp310-win_amd64.whl (45.4 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp36-cp36m-macosx_10_14_x86_64.macosx_10_10_x86_64.whl (42.2 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.manylinux_2_24_i686.whl (160.6 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (171.1 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl (195.1 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (201.7 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp36-cp36m-win32.whl (40.2 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp36-cp36m-win_amd64.whl (44.8 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp37-cp37m-macosx_10_14_x86_64.macosx_10_10_x86_64.whl (42.2 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.manylinux_2_24_i686.whl (161.7 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (172.1 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl (196.5 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (201.2 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp37-cp37m-win32.whl (40.2 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp37-cp37m-win_amd64.whl (44.7 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp38-cp38-macosx_10_14_x86_64.macosx_10_10_x86_64.whl (42.5 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.manylinux_2_24_i686.whl (185.8 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (192.1 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl (220.2 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (227.4 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp38-cp38-win32.whl (40.8 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp38-cp38-win_amd64.whl (45.3 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp39-cp39-macosx_10_14_x86_64.macosx_10_10_x86_64.whl (42.9 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.manylinux_2_24_i686.whl (177.8 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (181.2 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl (213.9 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (222.2 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp39-cp39-win32.whl (40.8 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0-cp39-cp39-win_amd64.whl (45.4 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size wsgi_lineprof-0.14.0.tar.gz (62.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page