The simplest way would be to change app.run() to
import cProfile
cProfile.run("app.run()")
Now when you hit ctrl+c from the terminal, the call graph will be printed.
If there is a particular function that you think is the culprit, you can
always pass it into cProfile.run. For example, say there is a function in
code.py called do_something, you could do the following from the python
shell:
import code
import cProfile
cProfile.run("code.do_something()")
Check out the cProfile module though, since it supports dumping the profile
info to a file which can be read with the pstats module:
http://docs.python.org/2/library/profile.html#module-cProfile
Hope that helps,
Jeff
On Tuesday, October 22, 2013 7:25:51 AM UTC-5, megha wrote:
>
> How does one go about this?
>
> We have a web.py + wsgi + apache. And we'd want call graph profiling.
>
> Warm Regards,
> Megha
>
>
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/groups/opt_out.