mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Much more friendly route mapping.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user