use the GraphiteMiddleware from commonware

This commit is contained in:
Jeff Balogh 2011-07-06 10:44:44 -07:00
Родитель 08786d7c3e
Коммит ad07bb74ed
2 изменённых файлов: 1 добавлений и 12 удалений

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

@ -18,7 +18,6 @@ import commonware.log
import MySQLdb as mysql
import tower
import jingo
from statsd import statsd
import amo
from . import urlresolvers
@ -177,13 +176,3 @@ class TimingMiddleware(object):
msg = '{method} "{url}" ({code}) {time:.2f} [{auth}]'.format(**d)
timing_log.info(msg)
return response
class GraphiteMiddleware(object):
def process_response(self, request, response):
statsd.incr('response.%s' % response.status_code)
return response
def process_exception(self, request, exception):
statsd.incr('response.500')

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

@ -247,7 +247,7 @@ MIDDLEWARE_CLASSES = (
# AMO URL middleware comes first so everyone else sees nice URLs.
'amo.middleware.TimingMiddleware',
'commonware.response.middleware.GraphiteRequestTimingMiddleware',
'amo.middleware.GraphiteMiddleware',
'commonware.response.middleware.GraphiteMiddleware',
'amo.middleware.LocaleAndAppURLMiddleware',
# Mobile detection should happen in Zeus.
'mobility.middleware.DetectMobileMiddleware',