Previously some database queries that happened prior to the request
could be counted as part of the request's in-database processing time,
resulting in confusing output where get_events spent more time doing
database queries than the total time spent processing the request.
(imported from commit 509247462d276d6020a2970f62edb33a1d633087)
See PEP 328[1] for details. This feature was introduced in Python 2.5 and
will become mandatory in Python 3.
[1]: http://www.python.org/dev/peps/pep-0328
(imported from commit 7444eeba8a08d5f91b94c7921848f2274979bd76)
Also improve display of times passed -- we now use display short times
in milliseconds for easier reading.
(imported from commit 08e1e7e6acbef48453080864946f7602a3395e7c)
I don't like monkeypatching in general, but this will give us logging
of how much time is being spent in total on database queries on our
staging and prod instances for each of the views we have -- which
should help a lot with debugging performance problems.
The code being patched is identical in Django 1.5, so I don't expect
any issues upgrading in the near future.
I may work on a patch to upstream Django to support this as well.
(imported from commit 08624c7a30f1fd192a972973e0380dd6a131d84e)
When DEBUG=False, Django doesn't log the data at all. We can and
should add tracking of that at some point, but it requires patching
Django; so for now just log the data when DEBUG=True.
(imported from commit 2b9e6a4c68009733373724f38debe4e77313fdeb)
This should make it much easier to debug issues where a particular
user is hosing our API, for example.
(imported from commit cbea49fd1e11805cadf564bd9160d3d6bf7e0eca)
Previously we only got the user ID for /json requests, not /api
requests, and also only got the user ID, not the email address.
(imported from commit c3625f9c1a48430e35183be6c90a7855f3714948)