Much more friendly route mapping.

This commit is contained in:
Dannon Baker
2016-03-22 17:35:14 -04:00
parent be78aac509
commit 975c6f5eae
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -180,6 +180,7 @@ class WebApplication( object ):
# Is the method callable
if not callable( method ):
raise httpexceptions.HTTPNotFound( "Action not callable for " + path_info )
environ['controller_action_key'] = "%s.%s.%s" % ('api' if environ['is_api_request'] else 'web', controller_name, action or 'default')
# Combine mapper args and query string / form args and call
kwargs = trans.request.params.mixed()
kwargs.update( map )
@@ -32,5 +32,5 @@ class StatsdMiddleware(object):
start_time = time.time()
req = self.application(environ, start_response)
dt = int((time.time() - start_time) * 1000)
self.statsd_client.timing(environ.get('PATH_INFO', "NOPATH").strip('/').replace('/', '.'), dt)
self.statsd_client.timing(environ.get('controller_action_key', None) or environ.get('PATH_INFO', "NOPATH").strip('/').replace('/', '.'), dt)
return req