Ticket #14640: timing.patch
File timing.patch, 1.2 KB (added by , 14 years ago) |
---|
-
django/core/servers/basehttp.py
14 14 import stat 15 15 import sys 16 16 import urllib 17 import time 17 18 18 19 from django.core.management.color import color_style 19 20 from django.utils.http import http_date … … 267 268 self.base_env = environ 268 269 self.wsgi_multithread = multithread 269 270 self.wsgi_multiprocess = multiprocess 271 self.start_time = time.time() 270 272 271 273 def run(self, application): 272 274 """Invoke the application""" … … 447 449 448 450 def close(self): 449 451 try: 450 self.request_handler.log_request(self.status.split(' ',1)[0], self.bytes_sent) 452 time_elapsed = time.time() - self.start_time 453 code = self.status.split(' ',1)[0] 454 size = self.bytes_sent 455 self.request_handler.log_message('"%s" %s %s %0.2f', 456 self.request_handler.requestline, str(code), str(size), 457 time_elapsed) 451 458 finally: 452 459 try: 453 460 if hasattr(self.result,'close'):