Chris Lamb

django-dumpslow

BlogProjectsAbout

View all my projects »

mysqldumpslow for Django projects.


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.

You can install django-dumpslow from PyPI:

$ pip install django-dumpslow
… or by adding django-dumpslow to your requirements.txt and re-running pip install -r requirements.txt.

You can browse the source tree, create or file bugs or download the code from Git:

$ git clone https://github.com/lamby/django-dumpslow

django-dumpslow is released under the BSD license.

View all my projects »