Django profiling with hotshot and kcachegrind
Testing django applications
RequirementsYour application needs to run under apache / mod_python. Here is a simple config: You don't use:
By default logs are saved to /var/log/cmsprofile and the folder must exists and apache hast to have write permissions on it. Now when you call a page of your django project a log file will be generated there (hidden file - starts with a dot). To make those files useful we will use KCachegrind.
Using Kcachegrindkcachegrind is a KDE application for profilers logs visualisation. To use Kcachegrind we need to convert hotshot logs using one of kcachegrind helpers:
hotshot2calltree file.prof > cachegrind.out.01hotshot2calltree will generate a log file that can be used in kcachegrind:
hotshot for scriptsIt's very simple, like this: *prof file needs to be converted in the same way.