Skip to content

Commit

Permalink
Use Rack::Runtime middleware so the reported time includes the entire…
Browse files Browse the repository at this point in the history
… middleware stack
  • Loading branch information
josh committed Dec 22, 2009
1 parent df7faef commit 2d0c703
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion actionpack/lib/action_controller/metal/benchmarking.rb
Expand Up @@ -53,7 +53,6 @@ def process_action(*args)
log_message << " [#{complete_request_uri rescue "unknown"}]" log_message << " [#{complete_request_uri rescue "unknown"}]"


logger.info(log_message) logger.info(log_message)
response.headers["X-Runtime"] = "%.0f" % ms
else else
super super
end end
Expand Down
1 change: 1 addition & 0 deletions railties/lib/rails/application.rb
Expand Up @@ -208,6 +208,7 @@ def call(env)
initializer :initialize_middleware_stack do initializer :initialize_middleware_stack do
if config.frameworks.include?(:action_controller) if config.frameworks.include?(:action_controller)
config.middleware.use(::Rack::Lock, :if => lambda { ActionController::Base.allow_concurrency }) config.middleware.use(::Rack::Lock, :if => lambda { ActionController::Base.allow_concurrency })
config.middleware.use(::Rack::Runtime)
config.middleware.use(ActionDispatch::ShowExceptions, lambda { ActionController::Base.consider_all_requests_local }) config.middleware.use(ActionDispatch::ShowExceptions, lambda { ActionController::Base.consider_all_requests_local })
config.middleware.use(ActionDispatch::Callbacks, lambda { ActionController::Dispatcher.prepare_each_request }) config.middleware.use(ActionDispatch::Callbacks, lambda { ActionController::Dispatcher.prepare_each_request })
config.middleware.use(lambda { ActionController::Base.session_store }, lambda { ActionController::Base.session_options }) config.middleware.use(lambda { ActionController::Base.session_store }, lambda { ActionController::Base.session_options })
Expand Down

0 comments on commit 2d0c703

Please sign in to comment.