use the GraphiteMiddleware from commonware
This commit is contained in:
Родитель
08786d7c3e
Коммит
ad07bb74ed
|
@ -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',
|
||||
|
|
Загрузка…
Ссылка в новой задаче