Add SQL Profiling to djblets profiling log

Review Request #590 — Created Oct. 13, 2008 and submitted

Information

Navi (deprecated)
trunk

Reviewers

When profiling pages, just having the python profile isn't very helpful if 99% of the time is spent in database queries. This change adds the ability to track SQL queries (and where they came from). This isn't quite as awesome as it could be regarding settings.DEBUG, but I need to think about the best way to do that. django doesn't make it easy to replace the CursorDebugWrapper in a sane way.
Ran with this code and looked at profiling information.
chipx86
  1. Looks good. It would be nice to have a big ol' comment near settings.DEBUG explaining why we have to do this and how it'd be nice to not have to, though.
  2. trunk/djblets/djblets/log/middleware.py (Diff revision 1)
     
     
    I'm not thrilled about doing this, but I don't really know what else we'd do, aside from replacing BaseDatabaseWrapper.cursor() on the fly.
  3.