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.



23
24
25
# File 'lib/new_relic/control/profiling.rb', line 23

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)


10
11
12
# File 'lib/new_relic/control/profiling.rb', line 10

def profiling?
  @profiling
end

#profiling_available?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
# File 'lib/new_relic/control/profiling.rb', line 14

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