From 251923c7a85a303d74b41255c39d8928ffa109ea Mon Sep 17 00:00:00 2001 From: Paul Nikitochkin Date: Mon, 11 Nov 2013 19:56:02 +0200 Subject: Instrument each load config initializer In order to simplify profiling loading of initializers, added instument for tracking load config initializer event from `config/initializers` --- railties/lib/rails/engine.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 1296c0a843..3f109debdc 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -611,7 +611,7 @@ module Rails initializer :load_config_initializers do config.paths["config/initializers"].existent.sort.each do |initializer| - load(initializer) + load_config_initializer(initializer) end end @@ -645,6 +645,12 @@ module Rails protected + def load_config_initializer(initializer) + ActiveSupport::Notifications.instrument('load_config_initializer.railties', initializer: initializer) do + load(initializer) + end + end + def run_tasks_blocks(*) #:nodoc: super paths["lib/tasks"].existent.sort.each { |ext| load(ext) } -- cgit v1.2.3