class RubyProf::MethodInfo

The MethodInfo class is used to track information about each method that is profiled. You cannot create a MethodInfo object directly, they are generated while running a profile.

Public Instance Methods

called() click to toggle source

The number of times this method was called

   # File lib/ruby-prof/method_info.rb
31 def called
32   self.measurement.called
33 end
children_time() click to toggle source

The time this method's children took to execute

   # File lib/ruby-prof/method_info.rb
51 def children_time
52   self.total_time - self.self_time - self.wait_time
53 end
full_name() click to toggle source

Returns the full name of a class. The interpretation of method names is:

  • MyObject#test - An method defined in a class

  • <Class:MyObject>#test - A method defined in a singleton class.

  • <Module:MyObject>#test - A method defined in a singleton module.

  • <Object:MyObject>#test - A method defined in a singleton object.

   # File lib/ruby-prof/method_info.rb
15 def full_name
16   decorated_class_name = case self.klass_flags
17                          when 0x2
18                            "<Class::#{klass_name}>"
19                          when 0x4
20                            "<Module::#{klass_name}>"
21                          when 0x8
22                            "<Object::#{klass_name}>"
23                          else
24                            klass_name
25                          end
26 
27   "#{decorated_class_name}##{method_name}"
28 end
min_depth() click to toggle source

The min call depth of this method

   # File lib/ruby-prof/method_info.rb
56 def min_depth
57   @min_depth ||= callers.map(&:depth).min
58 end
self_time() click to toggle source

The time this method took to execute

   # File lib/ruby-prof/method_info.rb
41 def self_time
42   self.measurement.self_time
43 end
total_time() click to toggle source

The total time this method took - includes self time + wait time + child time

   # File lib/ruby-prof/method_info.rb
36 def total_time
37   self.measurement.total_time
38 end
wait_time() click to toggle source

The time this method waited for other fibers/threads to execute

   # File lib/ruby-prof/method_info.rb
46 def wait_time
47   self.measurement.wait_time
48 end