Skip to main content

Django application to log and summarize slow requests

Project description

From: http://chris-lamb.co.uk/projects/django-dumpslow/

django-dumpslow is a reusable Django application that logs requests that take a long time to execute and provides an tool to summarise the resulting data.

Modelled on mysqldumpslow, django-dumpslow is intended as a tool to determine which parts of a project might benefit most from optimisation and to provide valuable empirical data.

The tool groups requests that are similar by exploiting Django’s ability to reverse URLs - requests that that use the same view should not counted distinctly. Views can then be grouped by the total accumulated time spent by that view or simply by their raw frequency in the logs.

Additionally, if the log entries contain timestamps then django-dumpslow can limit queries by a user-defined interval. This can be useful for generating regular reports of slow pages, perhaps by regularly emailing them to a development list.

Data is stored in Redis to allow easy collation of data from multiple front-end servers (django-dumpslow requires the Redis Python client library).

An example output is:

$ ./manage.py dumpslow View Accumulated time ===================================================== example.views.slow 92.88 /unknown (unreversible url) 16.84

django-dumpslow ships with an example project that demonstrates its functionality.

Installation

  1. Get Dedis working in django, it’s required. You’ll need a redis server running and REDIS_HOST and REDIS_PORT set in settings.py

  2. Add the following to INSTALLED_APPS in settings.py:

    'django_dumpslow'
  3. Add the following to MIDDLEWARE_CLASSES in settings.py:

    'django_dumpslow.middleware.LogLongRequestMiddleware'

License

django-dumpslow is released under the BSD license.

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

django-dumpslow-2.0.1.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file django-dumpslow-2.0.1.tar.gz.

File metadata

File hashes

Hashes for django-dumpslow-2.0.1.tar.gz
Algorithm Hash digest
SHA256 9c7c333efae65094117be8ff90d87afd90f6f054f64a6ee3d8610d123deceb11
MD5 b90d87358cce82fbb5355f36f7a06d27
BLAKE2b-256 9fe9596774cb85b4d627b0047c2ac90c1db5a5fcec7888e0930bf41c3c057aef

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