diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-12-22 16:18:22 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-22 16:18:22 -0600 |
commit | 2d0c703c922758dc36df8a20a56894484013b0f1 (patch) | |
tree | 6daceec54de9a679f22e0fc5bd212968ecb916d6 | |
parent | df7faef68e833efeef0dca3e07e0355f5042bb36 (diff) | |
download | rails-2d0c703c922758dc36df8a20a56894484013b0f1.tar.gz rails-2d0c703c922758dc36df8a20a56894484013b0f1.tar.bz2 rails-2d0c703c922758dc36df8a20a56894484013b0f1.zip |
Use Rack::Runtime middleware so the reported time includes the entire middleware stack
-rw-r--r-- | actionpack/lib/action_controller/metal/benchmarking.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/application.rb | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/benchmarking.rb b/actionpack/lib/action_controller/metal/benchmarking.rb index e58df69172..f73f635b0d 100644 --- a/actionpack/lib/action_controller/metal/benchmarking.rb +++ b/actionpack/lib/action_controller/metal/benchmarking.rb @@ -53,7 +53,6 @@ module ActionController #:nodoc: log_message << " [#{complete_request_uri rescue "unknown"}]" logger.info(log_message) - response.headers["X-Runtime"] = "%.0f" % ms else super end diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index e6f2d30429..d7a89ba2be 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -208,6 +208,7 @@ module Rails initializer :initialize_middleware_stack do if config.frameworks.include?(:action_controller) 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::Callbacks, lambda { ActionController::Dispatcher.prepare_each_request }) config.middleware.use(lambda { ActionController::Base.session_store }, lambda { ActionController::Base.session_options }) |