[mod_python] Profiling mod_python with callables?

Webb Sprague webb.sprague at gmail.com
Sun Sep 23 22:19:03 EDT 2007

Could anyone help me think about the following problem?

I have a handler, call it handler.py, in which I assign callable
objects to variables, creating pages through the magic of URL mapping.
 For example:

class Foo(object):
    def __init__(self, title):
        self.title = title

    def __call__(self, whatever):
        print "<title>" + title + "</title>"

page1 = Foo('Title 1')
page2 = Foo('Title 2')

You can thus browse http://blah.com/handler/page1 and

I would like to profile everything from this handler page down,
preferably with a single command like hotshot.profile_everything(...)
near the top of handler.py.

Can anyone describe how?

Thanks, and let me know if I can submit more information.  I haven't
included the code because there is just so much of it...

More information about the Mod_python mailing list