I'm currently working on an existing Django project which runs rather slowly (I assume it's mostly due to the AJAX calls). However, in order to prioritize optimization, I'd like to know what the numbers behind the HTTP Response codes mean.
[03/Dec/2011 22:25:00] "GET /userbase HTTP/1.1" 200 5914 <--This number
[03/Dec/2011 22:25:39] "GET /cohorts?weekly=true HTTP/1.1" 200 27985 <--This too
[03/Dec/2011 22:26:13] "GET /cohorts?weekly=false HTTP/1.1" 200 11416 <--and this one
Since the ones that take longer have larger numbers, I assume it's how long it takes to get a response. But how is this measured? In milliseconds? Clarification would be appreciated.
HttpResponse (source code) provides an inbound HTTP request to a Django web application with a text response. This class is most frequently used as a return object from a Django view.
REST framework includes a set of named constants that you can use to make your code more obvious and readable. The full set of HTTP status codes included in the status module is listed below. The module also includes a set of helper functions for testing if a status code is in a given range.
403 (Forbidden) A 403 response is not a case of insufficient client credentials; that would be 401 (“Unauthorized”). Authentication will not help, and the request SHOULD NOT be repeated.
Those are the size of the response in bytes. The longer ones are probably larger responses that take longer to calculate. Unfortunately, the output doesn't show time elapsed for requests, though I believe there was a feature request with that at one point.
If you're concerned about how long your requests are taking to complete, you might want to look into installing django-extensions and using the RunProfileServer to build a report.
https://github.com/django-extensions/django-extensions
http://packages.python.org/django-extensions/runprofileserver.html
If you need more comprehensive production logging, check out django-sentry.
https://github.com/django-extensions/django-extensions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With