##// END OF EJS Templates
metrics: add response code, and fix user problem on metrics
super-admin -
r4794:f0b7e732 default
parent child Browse files
Show More
@@ -63,18 +63,22 b' class RequestWrapperTween(object):'
63 63
64 64 statsd = request.registry.statsd
65 65 if statsd:
66 resp_code = response.status_code
67 user_id = getattr(_auth_user, 'user_id', _auth_user)
66 68 elapsed_time_ms = 1000.0 * total
67 69 statsd.timing(
68 70 'rhodecode_req_timing', elapsed_time_ms,
69 71 tags=[
70 72 "path:{}".format(_path),
71 "user:{}".format(_auth_user.user_id)
73 "user:{}".format(user_id),
74 "code:{}".format(resp_code)
72 75 ]
73 76 )
74 77 statsd.incr(
75 78 'rhodecode_req_count', tags=[
76 79 "path:{}".format(_path),
77 "user:{}".format(_auth_user.user_id)
80 "user:{}".format(user_id),
81 "code:{}".format(resp_code)
78 82 ])
79 83
80 84 return response
General Comments 0
You need to be logged in to leave comments. Login now