Commit Graph

27 Commits

Author SHA1 Message Date
Tim Abbott ce410799b2 Fix buggy logging of database query time.
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)
2013-06-28 15:57:28 -04:00
Scott Feeney 83cd963c49 Remove unused imports
(imported from commit 9e3050c72a2d1137b9096c6cfa1c3945341b9a56)
2013-06-27 16:22:39 -04:00
Leo Franchi 0b5b1dafc4 Add a rate limiting system to our backend
(imported from commit a1218618918b4dedc77307e2f277665e7dd8fa22)
2013-06-04 09:43:09 -04:00
Leo Franchi df6a93ddb6 Log time spent in markdown to statsd
(imported from commit 736a4ddf0716cf365cfaafd8f22a88de00d126bd)
2013-05-31 15:57:53 -04:00
Tim Abbott c98b37550e Record how much time is spent in the markdown parser.
(imported from commit c382f4f88ae253a47e05b3d15c6d21bc0cbb2bb7)
2013-05-22 14:41:57 -04:00
Leo Franchi d9d1ece5a4 Typo fix, log num of memcached queries not as timing
(imported from commit 60087a38a3204187ed9957a5897b5e81ef875b27)
2013-05-14 09:31:17 -04:00
Leo Franchi 32dcc75b08 Use path instead of full path for statsd logging
(imported from commit 48ddab1ed5b9fd6c6b87a2eb8c5119eb686f23ee)
2013-05-13 12:23:28 -04:00
Leo Franchi f7850d741a Graph time spent in memcached and num queries sent to memcached
(imported from commit 1214679d52448aac1a19aaa878ea078b2a16b8c9)
2013-05-13 12:23:28 -04:00
Leo Franchi de44f08772 Fix typo and send proper dbtime to statsd
(imported from commit 87e982de71e005ed110200b2f9afeec488dcfc51)
2013-05-01 17:24:38 -04:00
Tim Abbott 66b3c1fbff Log time spent querying memcached in logs when larger than 5ms.
(imported from commit a4de15026d24526a446b724500d1194dce824d1a)
2013-04-24 10:44:56 -04:00
Tim Abbott 5e22778843 Use a function for stopping/restarting time logging for longpolling.
(imported from commit 11b772deaa126fcc7e7605d467022b22d9e98cb0)
2013-04-24 10:44:56 -04:00
Luke Faraone 71a91197fa Enable absolute imports.
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)
2013-04-23 09:51:17 -07:00
Leo Franchi 652b821d64 Add a bunch of statsd logging
(imported from commit 8c17a76fed08c34abab3cc45d76a0fb30774d73a)
2013-04-18 18:05:52 -04:00
Luke Faraone 2be8f80f47 Make request._client a public member, dropping the '_'.
(imported from commit 5fc7ab57157ceb40c8bca9b0c97a47d8fac6745b)
2013-03-28 07:53:36 -07:00
Tim Abbott 6fd4bf38c0 logs: Don't display database time when there were no queries.
(imported from commit 71297c920b63578ebc2770954345bfb9d4d8937f)
2013-03-27 08:19:27 -04:00
Tim Abbott 144987e581 logs: Provide total time passed for longpolled requests.
Also improve display of times passed -- we now use display short times
in milliseconds for easier reading.

(imported from commit 08e1e7e6acbef48453080864946f7602a3395e7c)
2013-03-27 08:19:27 -04:00
Tim Abbott 887389d16c logs: Output timestamps in milliseconds when less than a second.
(imported from commit 150038059a1d7c677004edf27d4af2e48bf41285)
2013-03-27 08:19:27 -04:00
Tim Abbott e080be82fb Add the user's client string to our Django logs.
This should let us distinguish e.g. mobile from API bots.

(imported from commit 192114a0f79bfa7fb918e8c026da63ef772c2449)
2013-03-15 16:37:40 -04:00
Tim Abbott ff099f9291 logging: Fix super verbose logging of 404 errors.
(imported from commit bb2b4f0c3cf37c16d5c634d22b7cc576ee00e5f4)
2013-02-12 16:36:13 -05:00
Tim Abbott 54b10a292c Monkeypatch Django cursor to log query times even when DEBUG=False.
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)
2013-02-12 12:01:02 -05:00
Tim Abbott d0953bc8a1 Log time spent doing database queries when DEBUG=True.
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)
2013-02-12 11:07:36 -05:00
Tim Abbott c24e05f0e9 Log requestor email address for non-error requests too.
This should make it much easier to debug issues where a particular
user is hosing our API, for example.

(imported from commit cbea49fd1e11805cadf564bd9160d3d6bf7e0eca)
2013-02-12 11:07:36 -05:00
Tim Abbott a3a0880266 middleware: Improve logging of users causing 40x errors.
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)
2013-02-05 14:36:48 -05:00
Tim Abbott fe100d0047 Log a message with details on any 40x responses.
(imported from commit d1c3cf28ec55cb507f4a0c17168b352323b11d5c)
2013-02-01 14:50:28 -05:00
Zev Benjamin bf5ce4783d Move @has_request_variables error responses to middleware
This will now allow us to use @has_request_variables on helper
functions.

(imported from commit 799d71477654eac7fd8192cfc5bb88b78053532d)
2012-12-20 14:26:36 -05:00
Tim Abbott 7ae73fabd4 Log how long requests take to process.
(imported from commit 89915f859e4493ff04a34d198ac6df5541b743cc)
2012-11-14 15:52:57 -05:00
Keegan McAllister 94f107e281 Log all requests
runserver already prints them to the console, but runfcgi doesn't.

(imported from commit 3450e3fd65ef3990729c94e80dad4fc3c89f0e64)
2012-10-17 18:23:02 -04:00