Version 1 (modified by 19 years ago) ( diff ) | ,
---|
django.core.handlers.profiler-hotshot
provides profiling support for Django when using mod_python. Here's a similar solution for the internal development webserver.
Apply the included patch to django/core/management.py
and start Django with manage.py runserver
. Each request will create a .prof
file in your /tmp
directory. You can then open a Python shell and print the statistics:
>>> import hotshot.stats >>> stats = hotshot.stats.load("stones.prof") >>> stats.strip_dirs() >>> stats.sort_stats('time', 'calls') >>> stats.print_stats(20)
Attachments (5)
-
runserver-profiler.diff
(1.3 KB
) - added by 19 years ago.
patch for management.py enables profiling for runserver
-
runserver-profiler2.diff
(1.2 KB
) - added by 18 years ago.
updated the patch against the latest revision
-
runserver-profiler2.2.diff
(1.2 KB
) - added by 18 years ago.
updated the patch against the latest revision and made the path configurable
-
profiler-cprofile.py
(547 bytes
) - added by 17 years ago.
Adapted profile handler to use cProfile module. Place in django/core/handlers and set PythonHandler in apache conf
-
runserver-profiler3.diff
(2.3 KB
) - added by 16 years ago.
New patch against r7569. Extend runserver command with '--profile' argument. Will run djangos development server with profiling output into systems temporary directory.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.