diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-06 22:23:29 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-06 22:24:16 +0100 |
commit | 74f6ccea201d778e020f8c758013d90ea8a5c8a1 (patch) | |
tree | 22ec5f5abfd89014a2402555200d557cc2fb463c /activesupport/lib | |
parent | 0c2d933f3636a3c66ab189806725eca36f11655c (diff) | |
download | rails-74f6ccea201d778e020f8c758013d90ea8a5c8a1.tar.gz rails-74f6ccea201d778e020f8c758013d90ea8a5c8a1.tar.bz2 rails-74f6ccea201d778e020f8c758013d90ea8a5c8a1.zip |
instrumenter should be accessible from ActiveSupport::Notifications.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/notifications.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/activesupport/lib/active_support/notifications.rb b/activesupport/lib/active_support/notifications.rb index d9bfcbfcab..3e96decb8c 100644 --- a/activesupport/lib/active_support/notifications.rb +++ b/activesupport/lib/active_support/notifications.rb @@ -44,11 +44,16 @@ module ActiveSupport class << self attr_writer :notifier - delegate :publish, :subscribe, :instrument, :to => :notifier + delegate :publish, :subscribe, :to => :notifier + delegate :instrument, :to => :instrumenter def notifier @notifier ||= Notifier.new end + + def instrumenter + Thread.current[:"instrumentation_#{notifier.object_id}"] ||= Instrumenter.new(notifier) + end end class Notifier @@ -67,13 +72,6 @@ module ActiveSupport def wait @queue.wait end - - delegate :instrument, :to => :current_instrumenter - - private - def current_instrumenter - Thread.current[:"instrumentation_#{object_id}"] ||= Notifications::Instrumenter.new(self) - end end end end |