Skip to main content

Logging Slow Requests

Perftools includes a logger that will monitor requests execution time. Once it hits the defined threshold, it will log to the named perftools logger, including the metadata for the request (as defined by Sentry’s logging spec).

from perftools.middleware.slowreq import SlowRequestLoggingMiddleware

app = SlowRequestLoggingMiddleware(app, threshold=100) # in ms

Remote Profiling

Profiles a request and saves the results to disk.

from perftools.middleware.remoteprof import RemoteProfilingMiddleware

app = RemoteProfilingMiddleware(app, outpath='/var/data/cprofile-results/', percent=10) # 10% of requests

Query Counts

Logs requests which exceed a maximum number of queries.

from perftools.middleware.querycount import QueryCountLoggingMiddleware

app = QueryCountLoggingMiddleware(app, threshold=100) # number of queries

Release files for django-perftools 0.7.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 django-perftools 0.7.2
File Size Uploaded
django-perftools-0.7.2.tar.gz 4.4 kB Details

Release files / django-perftools-0.7.2.tar.gz

Download URL django-perftools-0.7.2.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
606ec3ca105bf4546e2f83597a0c7a16858c4ec38ba927731a1c8b8278bc90fc
BLAKE2b-256 checksum
How to use checksums
db62f721aedceaa0b7479165a50dc7778f4577e6563fe9e4073772b209cc1b29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.7.2 This release

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

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