Skip to content

Commit

Permalink
propagates instrumentation extras to the given block
Browse files Browse the repository at this point in the history
  • Loading branch information
Túlio Ornelas committed Sep 4, 2016
1 parent 673e06f commit 73e42ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
spec/examples.txt
/tmp/
.DS_Store
config/phobos.yml
config/*.yml
log/*.log
.byebug_history
4 changes: 2 additions & 2 deletions lib/phobos/instrumentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module Instrumentation
NAMESPACE = 'phobos'

def instrument(event, extra = {})
ActiveSupport::Notifications.instrument("#{NAMESPACE}.#{event}", extra) do
yield if block_given?
ActiveSupport::Notifications.instrument("#{NAMESPACE}.#{event}", extra) do |extra|
yield(extra) if block_given?
end
end

Expand Down

0 comments on commit 73e42ee

Please sign in to comment.