Remove old timing code now that we have statsd. (Bug 703395)

This commit is contained in:
Allen Short 2011-12-07 14:37:28 -08:00
Родитель d9af400b48
Коммит 4573a8a99c
2 изменённых файлов: 0 добавлений и 21 удалений

Просмотреть файл

@ -162,26 +162,6 @@ class ReadOnlyMiddleware(object):
return jingo.render(request, 'amo/read-only.html', status=503)
timing_log = commonware.log.getLogger('z.timer')
class TimingMiddleware(object):
def process_request(self, request):
request._start = time.time()
def process_response(self, request, response):
auth = 'ANON'
if hasattr(request, 'user') and request.user.is_authenticated():
auth = 'AUTH'
d = {'method': request.method, 'time': time.time() - request._start,
'code': response.status_code, 'auth': auth,
'url': smart_str(request.path_info)}
msg = '{method} "{url}" ({code}) {time:.2f} [{auth}]'.format(**d)
timing_log.info(msg)
return response
pjax_log = commonware.log.getLogger('z.timer')

Просмотреть файл

@ -274,7 +274,6 @@ def JINJA_CONFIG():
MIDDLEWARE_CLASSES = (
# AMO URL middleware comes first so everyone else sees nice URLs.
'amo.middleware.TimingMiddleware',
'commonware.response.middleware.GraphiteRequestTimingMiddleware',
'commonware.response.middleware.GraphiteMiddleware',
'amo.middleware.LocaleAndAppURLMiddleware',