performance csv exporting for pyramid_debugtoolbar
Project description
pyramid_debugtoolbar_api_performance
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
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:
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:
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
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
Hashes for pyramid_debugtoolbar_api_performance-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c942aad689133ceb01442ac418422886f64fc014b8ffd696e51f85a18c8a00a4 |
|
MD5 | d2e9a240b2fd59bd61e8d14f49250f05 |
|
BLAKE2b-256 | 2a8d86d38eec028af009fbe335caef2ea015c3d39b875d7acc1b05e2c156f501 |