##// END OF EJS Templates
metrics: further adjustments....
super-admin -
r4796:317404db default
parent child Browse files
Show More
@@ -182,7 +182,7 b' def error_handler(exception, request):'
182
182
183 statsd = request.registry.statsd
183 statsd = request.registry.statsd
184 if statsd and base_response.status_code > 499:
184 if statsd and base_response.status_code > 499:
185 statsd.incr('rhodecode_exception')
185 statsd.incr('rhodecode_exception', tags=["code:{}".format(base_response.status_code)])
186
186
187 error_explanation = base_response.explanation or str(base_response)
187 error_explanation = base_response.explanation or str(base_response)
188 if base_response.status_code == 404:
188 if base_response.status_code == 404:
@@ -34,6 +34,7 b' from rhodecode.lib.utils2 import safe_st'
34 from rhodecode.lib.exceptions import (
34 from rhodecode.lib.exceptions import (
35 HTTPLockedRC, HTTPBranchProtected, UserCreationError)
35 HTTPLockedRC, HTTPBranchProtected, UserCreationError)
36 from rhodecode.model.db import Repository, User
36 from rhodecode.model.db import Repository, User
37 from rhodecode.lib.statsd_client import StatsdClient
37
38
38 log = logging.getLogger(__name__)
39 log = logging.getLogger(__name__)
39
40
@@ -219,6 +220,10 b' def post_pull(extras):'
219 'user.pull', action_data={'user_agent': extras.user_agent},
220 'user.pull', action_data={'user_agent': extras.user_agent},
220 user=audit_user, repo=repo, commit=True)
221 user=audit_user, repo=repo, commit=True)
221
222
223 statsd = StatsdClient.statsd
224 if statsd:
225 statsd.incr('rhodecode_pull')
226
222 output = ''
227 output = ''
223 # make lock is a tri state False, True, None. We only make lock on True
228 # make lock is a tri state False, True, None. We only make lock on True
224 if extras.make_lock is True and not is_shadow_repo(extras):
229 if extras.make_lock is True and not is_shadow_repo(extras):
@@ -264,6 +269,10 b' def post_push(extras):'
264 'commit_ids': commit_ids[:400]},
269 'commit_ids': commit_ids[:400]},
265 user=audit_user, repo=repo, commit=True)
270 user=audit_user, repo=repo, commit=True)
266
271
272 statsd = StatsdClient.statsd
273 if statsd:
274 statsd.incr('rhodecode_push')
275
267 # Propagate to external components.
276 # Propagate to external components.
268 output = ''
277 output = ''
269 # make lock is a tri state False, True, None. We only release lock on False
278 # make lock is a tri state False, True, None. We only release lock on False
@@ -69,15 +69,15 b' class RequestWrapperTween(object):'
69 statsd.timing(
69 statsd.timing(
70 'rhodecode_req_timing', elapsed_time_ms,
70 'rhodecode_req_timing', elapsed_time_ms,
71 tags=[
71 tags=[
72 "path:{}".format(_path),
72 #"path:{}".format(_path),
73 "user:{}".format(user_id),
73 #"user:{}".format(user_id),
74 "code:{}".format(resp_code)
74 "code:{}".format(resp_code)
75 ]
75 ]
76 )
76 )
77 statsd.incr(
77 statsd.incr(
78 'rhodecode_req_count', tags=[
78 'rhodecode_req_count', tags=[
79 "path:{}".format(_path),
79 #"path:{}".format(_path),
80 "user:{}".format(user_id),
80 #"user:{}".format(user_id),
81 "code:{}".format(resp_code)
81 "code:{}".format(resp_code)
82 ])
82 ])
83
83
General Comments 0
You need to be logged in to leave comments. Login now