Skip to main content

performance csv exporting for pyramid_debugtoolbar

Project description

pyramid_debugtoolbar_api_performance

.. image:: https://github.com/jvanasco/pyramid_debugtoolbar_api_performance/workflows/Python%20package/badge.svg :alt: Build Status

pyramid_debugtoolbar_api_performance extends the existing pyramid_debugtoolbar Performance Panel to support downloadable CSV files of profiling data.

This package does not replace the default panel, and requires it to be active.

This package is designed for application profile and to be a useful part of test suites, allowing developers to run a series of tests and log the Performance performance.

The package exposes two routes for CSV data:

  • timing
  • function_calls

Both correlate to the official Performance panel data.

The urls are generated in a machine-friendly format, so you can regex the request_id off a page and pull it from the API. This is explained below...

NOTES:

This packages requires pyramid_debugtoolbar 4.0 or newer

How to use this package

Update your ENVIRONMENT.ini file

.. code-block:: python

debugtoolbar.includes = pyramid_debugtoolbar_api_performance

You MUST be using pyramid_debugtoolbar with the Performance panel enabled. This package simply piggybacks on the existing module's work to log queries.

You MUST use debugtoolbar.includes. This will not work properly via pyramid.includes

You can access a csv of the Profiling report via the following url hack:

.. code-block:: python

url_html = '/_debug_toolbar/{request_id}'
url_api =  '/_debug_toolbar/api-performance/timing-{request_id}.csv'
url_api =  '/_debug_toolbar/api-performance/function_calls-{request_id}.csv'

The file will be downloaded and offer a content-disposition as:

.. code-block:: shell

performance-{request_id}.csv

Configuration

By default, this package writes CSV files using "UTF-8" encoding.

To change this, use the environment variable pyramid_debugtoolbar_api_performance_encoding

.. code-block:: shell

export pyramid_debugtoolbar_api_performance_encoding=ascii

Project details


Download files

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

Source Distribution

File details

Details for the file pyramid_debugtoolbar_api_performance-0.3.1.tar.gz.

File metadata

  • Download URL: pyramid_debugtoolbar_api_performance-0.3.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for pyramid_debugtoolbar_api_performance-0.3.1.tar.gz
Algorithm Hash digest
SHA256 9aebb13bcb94237e417d10bc98ca1e4018a7af3c4d6bbd317c5c6e9eabfd4fb2
MD5 fc4a2c8131cd848579abd6f045e1c94f
BLAKE2b-256 b195ae6d559cc77f3f501d2097c6ff60ae698dd6435ff15975cdc8bd0d4cde89

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page