Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RUBY-1267 RubyProf based on transaction
This replaces the old ControllerInstrumentation based method that we were using to divert to a RubyProf based profiling of the method instead of tracing. By hooking into our transaction events, this should work across Rails versions seamlessly without duplicating work for Rails 4.x. This also removed the old fronting of these variables via NewRelic::Control, which is nice to tidy up.
- Loading branch information
1 parent
254b67c
commit 7a0ccf0
Showing
9 changed files
with
60 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# encoding: utf-8 | ||
# This file is distributed under New Relic's license terms. | ||
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details. | ||
|
||
DependencyDetection.defer do | ||
named :rubyprof | ||
|
||
depends_on do | ||
defined?(::RubyProf) | ||
end | ||
|
||
executes do | ||
NewRelic::Agent.instance.events.subscribe(:start_transaction) do | ||
if NewRelic::Agent.config[:'profiling.enabled'] | ||
::RubyProf.start | ||
end | ||
end | ||
|
||
NewRelic::Agent.instance.events.subscribe(:transaction_finishing) do | ||
if NewRelic::Agent.config[:'profiling.enabled'] | ||
profile = ::RubyProf.stop | ||
NewRelic::Agent.instance.transaction_sampler.notice_profile(profile) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters