Merge pull request #834 from AlanCoding/jump-the-start-line

This commit is contained in:
Jake McDermott 2017-12-13 22:43:54 -05:00 committed by GitHub
commit 07cfa6cba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,8 @@ class TimingMiddleware(threading.local):
self.prof.enable()
def process_response(self, request, response):
if not hasattr(self, 'start_time'): # some tools may not invoke process_request
return response
total_time = time.time() - self.start_time
response['X-API-Total-Time'] = '%0.3fs' % total_time
if settings.AWX_REQUEST_PROFILE: