Module: NewRelic::Control::Profiling

Included in:
NewRelic::Control
Defined in:
lib/new_relic/control/profiling.rb

Instance Method Summary collapse

Instance Method Details

#profiling=(val) ⇒ Object

Set the flag for capturing profiles in dev mode. If RubyProf is not loaded a true value is ignored.



19
20
21
# File 'lib/new_relic/control/profiling.rb', line 19

def profiling=(val)
  @profiling = profiling_available? && val && defined?(RubyProf)
end

#profiling?Boolean

A flag used in dev mode to indicate if profiling is available

Returns:

  • (Boolean)


6
7
8
# File 'lib/new_relic/control/profiling.rb', line 6

def profiling?
  @profiling
end

#profiling_available?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
# File 'lib/new_relic/control/profiling.rb', line 10

def profiling_available?
  @profiling_available ||=
    begin
      require 'ruby-prof'
      true
    rescue LoadError; end
end