aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/notifications.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-07-25 20:46:42 +0200
committerJosé Valim <jose.valim@gmail.com>2010-07-25 20:46:42 +0200
commitff0d842454571d78addd1fe9d4f232b600881b1a (patch)
treea9c07676d888d14ab5f2298dfe676fbb0ab3eb26 /activesupport/lib/active_support/notifications.rb
parent0d0e79398308e6147e59d99a48c7e6d952e5848c (diff)
downloadrails-ff0d842454571d78addd1fe9d4f232b600881b1a.tar.gz
rails-ff0d842454571d78addd1fe9d4f232b600881b1a.tar.bz2
rails-ff0d842454571d78addd1fe9d4f232b600881b1a.zip
Revert the previous three commits.
* AS::Notifications#instrument should not measure anything, it is not its responsibility; * Adding another argument to AS::Notifications#instrument API needs to be properly discussed;
Diffstat (limited to 'activesupport/lib/active_support/notifications.rb')
-rw-r--r--activesupport/lib/active_support/notifications.rb16
1 files changed, 3 insertions, 13 deletions
diff --git a/activesupport/lib/active_support/notifications.rb b/activesupport/lib/active_support/notifications.rb
index d65431a943..886d7183eb 100644
--- a/activesupport/lib/active_support/notifications.rb
+++ b/activesupport/lib/active_support/notifications.rb
@@ -47,21 +47,11 @@ module ActiveSupport
attr_writer :notifier
delegate :publish, :unsubscribe, :to => :notifier
- def instrument(name, payload = {}, info = nil)
+ def instrument(name, payload = {})
if @instrumenters[name]
- instrumenter.instrument(name, payload, info) {
- yield payload if block_given?
- }
+ instrumenter.instrument(name, payload) { yield payload if block_given? }
else
- value = nil
- if block_given?
- if info
- info[:elapsed] = Benchmark.ms { value = yield payload }
- else
- value = yield payload
- end
- end
- value
+ yield payload if block_given?
end
end