cprofile mod_python

11 views
Skip to first unread message

grafman

unread,
Apr 27, 2010, 5:23:08 PM4/27/10
to mod_python
I'm trying to use cprofile in a mod_python based application.

I point my web server to a profiling function that calls my "main"
function. I can't seem to get it to work correctly. I'm getting
garbage sent to my profile output and when I call pstats Its telling
me my main function is not defined. I've tried both cprofile.run and
cprofile.runctx.

def handler( req ):
f = '/tmp/foo.prof'
cProfile.run('mainprofiled(req)',f)
#stats = pstats.Stats(f)
return apache.OK

def mainprofiled(req):
#python code

Are there some good mod_python based profiling examples someone could
point me to?

--
You received this message because you are subscribed to the Google Groups "mod_python" group.
To post to this group, send email to mod_p...@googlegroups.com.
To unsubscribe from this group, send email to mod_python+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mod_python?hl=en.

Graham Dumpleton

unread,
Apr 28, 2010, 10:01:11 PM4/28/10
to mod_python
No one lives here. Use the mailing list instead.

http://mailman.modpython.org/mailman/listinfo/mod_python

grafman

unread,
Apr 29, 2010, 11:21:24 AM4/29/10
to mod_python
Thanks Graham.

On Apr 28, 8:01 pm, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages