class RubyProf::CallTree

The CallTree class is used to track the relationships between methods. It is a helper class used by RubyProf::MethodInfo to keep track of which methods called a given method and which methods a given method called. Each CallTree has a parent and target method. You cannot create a CallTree object directly, they are generated while running a profile.

Public Instance Methods

<=>(other) click to toggle source

Compares two CallTree instances. The comparison is based on the CallTree#parent, CallTree#target, and total time.

   # File lib/ruby-prof/call_tree.rb
36 def <=>(other)
37   if self.target == other.target && self.parent == other.parent
38     0
39   elsif self.total_time < other.total_time
40     -1
41   elsif self.total_time > other.total_time
42     1
43   else
44     self.target.full_name <=> other.target.full_name
45   end
46 end
called() click to toggle source

The number of times the parent method called the target method

   # File lib/ruby-prof/call_tree.rb
10 def called
11   self.measurement.called
12 end
children_time() click to toggle source

The time spent in child methods resulting from the parent method calling the target method

   # File lib/ruby-prof/call_tree.rb
30 def children_time
31   self.total_time - self.self_time - self.wait_time
32 end
self_time() click to toggle source

The self time (of the parent) resulting from the parent method calling the target method

   # File lib/ruby-prof/call_tree.rb
20 def self_time
21   self.measurement.self_time
22 end
total_time() click to toggle source

The total time resulting from the parent method calling the target method

   # File lib/ruby-prof/call_tree.rb
15 def total_time
16   self.measurement.total_time
17 end
wait_time() click to toggle source

The wait time (of the parent) resulting from the parent method calling the target method

   # File lib/ruby-prof/call_tree.rb
25 def wait_time
26   self.measurement.wait_time
27 end