aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-11-11 19:56:02 +0200
committerPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-11-16 21:47:08 +0200
commit251923c7a85a303d74b41255c39d8928ffa109ea (patch)
treeda3afd05f6f68737c914dcccd4486e3cd2524004 /railties/lib
parent93e752cfae4564eff9827de7ee16a24b1f832c91 (diff)
downloadrails-251923c7a85a303d74b41255c39d8928ffa109ea.tar.gz
rails-251923c7a85a303d74b41255c39d8928ffa109ea.tar.bz2
rails-251923c7a85a303d74b41255c39d8928ffa109ea.zip
Instrument each load config initializer
In order to simplify profiling loading of initializers, added instument for tracking load config initializer event from `config/initializers`
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/engine.rb8
1 files changed, 7 insertions, 1 deletions
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) }