Fix silent exception in response code capture

This commit is contained in:
Alexis Le-Quoc 2014-05-31 00:48:27 -04:00
parent 89a3c96700
commit 4bf1e1d468
2 changed files with 3 additions and 3 deletions

View File

@ -478,9 +478,9 @@ class Arbiter(object):
(pid, _) = workers.pop(0)
self.kill_worker(pid, signal.SIGQUIT)
self.log.info("%d workers",
self.log.info("{0} workers".format(len(workers)),
extra={"metric": "gunicorn.workers",
"value": len(self.WORKERS),
"value": len(workers),
"mtype": "gauge"})
def spawn_worker(self):

View File

@ -84,7 +84,7 @@ class Statsd(Logger):
duration_in_s = request_time.seconds + float(request_time.microseconds)/10**6
self.histogram("gunicorn.request.duration", duration_in_s)
self.increment("gunicorn.requests", 1)
self.increment("gunicorn.request.status.%d" % int(resp.status), 1)
self.increment("gunicorn.request.status.%d" % int(resp.status.split()[0]), 1)
# statsD methods
# you can use those directly if you want