Skip to content

Commit e4dbf49

Browse files
committed
Merge pull request peek#3 from TALlama/master
Fix a conflict with the `newrelic_rpm` gem. * TALlama/master: Fix a conflict with the `newrelic_rpm` gem.
2 parents 2ef8a85 + b5e7963 commit e4dbf49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/peek/views/gc.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,16 @@ def parse_result
5151
def setup_subscribers
5252
# Reset each counter when a new request starts
5353
before_request do |name, start, finish, id, payload|
54+
next if @profiler_already_enabled = ::GC::Profiler.enabled?
55+
5456
::GC::Profiler.enable
5557
::GC::Profiler.clear
5658
end
5759

5860
# Once the action is finished
5961
subscribe 'process_action.action_controller' do |name, start, finish, id, payload|
62+
next if @profiler_already_enabled
63+
6064
::GC::Profiler.disable
6165
::GC::Profiler.clear
6266
end

0 commit comments

Comments
 (0)