Skip to content

Commit

Permalink
[doc] Add more instruction on profiling hue server
Browse files Browse the repository at this point in the history
  • Loading branch information
bc Wong committed Apr 28, 2012
1 parent 0fe62b5 commit 875549a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.rst
Expand Up @@ -172,8 +172,12 @@ the file names is /tmp/<app_module>.<page_url>.<time_taken>.<timestamp>.prof.
Hue uses the hotshot profiling library for instrumentation. The documentation
for this library is located at: http://docs.python.org/library/hotshot.html.

To make use of the profiling data quickly, you can create a script that does
the following::
You can use kcachegrind to view the profiled data graphically::

$ hotshot2calltree /tmp/xyz.prof > /tmp/xyz.trace
$ kcachegrind /tmp/xyz.trace

More generally, you can programmatically inspect a trace::

#!/usr/bin/python
import hotshot.stats
Expand All @@ -188,4 +192,3 @@ time spent in that function, followed by the number of times the function was
called, and then prints out the top 100 time-wasters. For information on the
other stats available, take a look at this website:
http://docs.python.org/library/profile.html#pstats.Stats

0 comments on commit 875549a

Please sign in to comment.