← Back to team overview

launchpad-dev team mailing list archive

Trying to add storm tracing to scripts

 

Dear hackers

I need to add storm statement tracing to one of the scripts we've developed 
for Derived Distros so I can see if there's a performance improvement to be 
made.  I figured it would be a simple case of adding these three lines to the 
script (as advised by Rob):

    from canonical.launchpad.webapp.adapter import LaunchpadStatementTracer
    from storm.tracer import install_tracer 
    install_tracer(LaunchpadStatementTracer())

And then at the end of the script I should be able to do this:

    import sys
    import logging
    from zope.error.interfaces import IErrorReportingUtility
    oops = getUtility(IErrorReportingUtility).handling(sys.exc_info())
    logging.info("LOGGED OOPS: %s", oops.id)

However the oops it produces has no statement log and interestingly no stack 
trace.

http://pastebin.ubuntu.com/664318/

I don't have much experience with tinkering with the OOPS tools and stuff, am 
I doing something wrong or is there something else that's broken?

Thanks guys.
J


Follow ups