Skip to main content

Weni Profilers

The weni-profilers library allows you to add a simple profiler to a Django project to analyze the performance of views.

Setup in project

1. Install weni-profilers

pip install weni-profilers

2. Configure the middleware

MIDDLEWARE = [
    # ...
    'weni.profilers.CProfilerMiddleware',
]

Variables

USE_PROFILER = True
PROFILER_AUTH_TOKEN = "your-secret-key"
Name Description
USE_PROFILER This variable enables the profiler if it is True
PROFILER_AUTH_TOKEN Based on this variable, the middleware will authenticate the request

It is recommended that both are configured by environment variables, mainly PROFILER_AUTH_TOKEN

Using

To profile a view, add ?prof to the URL of the view you want to analyze:

http://localhost:8000/your-view/?prof

You can pass the following parameters in the URL to customize the output:

  • ?sort: Sorts the output by a specific metric. The default is "team". See the official documentation for all ordering options.
  • ?count: Defines the number of lines to be displayed. The default is 100.
  • ?download: Downloads the profile file for viewing in tools such as SnakeViz or RunSnakeRun.

Example URL with parameters:

http://localhost:8000/your-view/?prof&sort=cumulative&count=50&download

This repository is a fork of https://github.com/omarish/django-cprofile-middleware

Metadata

Release files for weni-profilers 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for weni-profilers 0.0.2
File Size Uploaded Provenance
weni_profilers-0.0.2.tar.gz 3.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for weni-profilers 0.0.2
File Interpreter ABI Platform
weni_profilers-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.2 kB

Release files / weni_profilers-0.0.2.tar.gz

Download URL weni_profilers-0.0.2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5ec613758de1a3efca31bdfec9a13301dec981979a22f9b1ce781be196aae39d
BLAKE2b-256 checksum
How to use checksums
00ebee8fa79d88e83c4d3acc9d3dc06da59a804105cb20bce70b77caf1cedc34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-33-generic

Release files / weni_profilers-0.0.2-py3-none-any.whl

Download URL weni_profilers-0.0.2-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3fe753b232f0beaadec23bcc1b08a4bb770e0a64ab25ea669c29bdddbbbe3d2e
BLAKE2b-256 checksum
How to use checksums
89993abfea7f9e92d514ba7e9d5db53d97ae13dc4a1f6a93921b2783a6fe84d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-33-generic

Security for weni-profilers 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page