class RubyProf::Thread

Public Instance Methods

detect_recursion() click to toggle source

This method detect recursive calls in the call tree of a given thread It should be called only once for each thread

# File lib/ruby-prof/thread.rb, line 15
def detect_recursion
  top_call_infos.each(&:detect_recursion)
end
recalc_recursion() click to toggle source
# File lib/ruby-prof/thread.rb, line 19
def recalc_recursion
  top_call_infos.each(&:recalc_recursion)
end
top_call_infos() click to toggle source
# File lib/ruby-prof/thread.rb, line 9
def top_call_infos
  top_methods.map(&:call_infos).flatten.select(&:root?)
end
top_methods() click to toggle source
# File lib/ruby-prof/thread.rb, line 3
def top_methods
  self.methods.select do |method_info|
    method_info.call_infos.detect(&:root?)
  end
end
total_time() click to toggle source
# File lib/ruby-prof/thread.rb, line 23
def total_time
  self.top_methods.inject(0) do |sum, method_info|
    method_info.call_infos.each do |call_info|
      if call_info.parent.nil?
        sum += call_info.total_time
      end
    end
    sum
  end
end