ruby-prof 1.4.3 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/CHANGES +59 -9
 - data/{README.rdoc → README.md} +2 -2
 - data/Rakefile +4 -4
 - data/bin/ruby-prof +100 -87
 - data/ext/ruby_prof/rp_allocation.c +140 -85
 - data/ext/ruby_prof/rp_allocation.h +8 -6
 - data/ext/ruby_prof/rp_call_tree.c +502 -369
 - data/ext/ruby_prof/rp_call_tree.h +47 -43
 - data/ext/ruby_prof/rp_call_trees.c +16 -8
 - data/ext/ruby_prof/rp_measure_allocations.c +10 -13
 - data/ext/ruby_prof/rp_measure_memory.c +8 -4
 - data/ext/ruby_prof/rp_measure_process_time.c +7 -6
 - data/ext/ruby_prof/rp_measurement.c +147 -20
 - data/ext/ruby_prof/rp_measurement.h +4 -1
 - data/ext/ruby_prof/rp_method.c +142 -83
 - data/ext/ruby_prof/rp_method.h +63 -62
 - data/ext/ruby_prof/rp_profile.c +933 -900
 - data/ext/ruby_prof/rp_profile.h +1 -0
 - data/ext/ruby_prof/rp_thread.c +433 -362
 - data/ext/ruby_prof/rp_thread.h +39 -39
 - data/ext/ruby_prof/ruby_prof.c +0 -2
 - data/ext/ruby_prof/ruby_prof.h +8 -0
 - data/ext/ruby_prof/vc/ruby_prof.vcxproj +11 -8
 - data/lib/ruby-prof/assets/call_stack_printer.html.erb +2 -1
 - data/lib/ruby-prof/compatibility.rb +14 -0
 - data/lib/ruby-prof/method_info.rb +8 -1
 - data/lib/ruby-prof/printers/abstract_printer.rb +2 -1
 - data/lib/ruby-prof/printers/call_tree_printer.rb +4 -10
 - data/lib/ruby-prof/printers/graph_html_printer.rb +1 -1
 - data/lib/ruby-prof/printers/multi_printer.rb +17 -17
 - data/lib/ruby-prof/profile.rb +70 -37
 - data/lib/ruby-prof/rack.rb +31 -21
 - data/lib/ruby-prof/version.rb +1 -1
 - data/lib/ruby-prof.rb +1 -1
 - data/ruby-prof.gemspec +2 -3
 - data/test/abstract_printer_test.rb +1 -0
 - data/test/alias_test.rb +97 -106
 - data/test/call_tree_builder.rb +126 -0
 - data/test/call_tree_test.rb +94 -0
 - data/test/call_tree_visitor_test.rb +1 -6
 - data/test/call_trees_test.rb +6 -6
 - data/test/{basic_test.rb → compatibility_test.rb} +8 -2
 - data/test/duplicate_names_test.rb +5 -5
 - data/test/dynamic_method_test.rb +24 -15
 - data/test/enumerable_test.rb +1 -1
 - data/test/exceptions_test.rb +2 -2
 - data/test/exclude_methods_test.rb +3 -8
 - data/test/exclude_threads_test.rb +4 -9
 - data/test/fiber_test.rb +74 -8
 - data/test/gc_test.rb +11 -9
 - data/test/inverse_call_tree_test.rb +33 -34
 - data/test/line_number_test.rb +37 -61
 - data/test/marshal_test.rb +16 -3
 - data/test/measure_allocations.rb +1 -5
 - data/test/measure_allocations_test.rb +642 -357
 - data/test/{measure_memory_trace_test.rb → measure_memory_test.rb} +180 -616
 - data/test/measure_process_time_test.rb +1566 -741
 - data/test/measure_wall_time_test.rb +179 -193
 - data/test/measurement_test.rb +82 -0
 - data/test/merge_test.rb +146 -0
 - data/test/method_info_test.rb +95 -0
 - data/test/multi_printer_test.rb +0 -5
 - data/test/no_method_class_test.rb +1 -1
 - data/test/pause_resume_test.rb +12 -16
 - data/test/printer_call_stack_test.rb +2 -2
 - data/test/printer_call_tree_test.rb +4 -4
 - data/test/printer_flat_test.rb +1 -1
 - data/test/printer_graph_html_test.rb +2 -2
 - data/test/printer_graph_test.rb +2 -2
 - data/test/printers_test.rb +14 -20
 - data/test/printing_recursive_graph_test.rb +2 -2
 - data/test/profile_test.rb +85 -0
 - data/test/recursive_test.rb +374 -155
 - data/test/scheduler.rb +363 -0
 - data/test/singleton_test.rb +1 -1
 - data/test/stack_printer_test.rb +5 -8
 - data/test/start_stop_test.rb +11 -14
 - data/test/test_helper.rb +11 -8
 - data/test/thread_test.rb +106 -15
 - data/test/unique_call_path_test.rb +28 -12
 - data/test/yarv_test.rb +11 -7
 - metadata +17 -29
 - data/ext/ruby_prof/rp_aggregate_call_tree.c +0 -59
 - data/ext/ruby_prof/rp_aggregate_call_tree.h +0 -13
 - data/test/measure_allocations_trace_test.rb +0 -375
 - data/test/temp.rb +0 -20
 
    
        data/test/recursive_test.rb
    CHANGED
    
    | 
         @@ -33,174 +33,393 @@ end 
     | 
|
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
            # --  Tests ----
         
     | 
| 
       35 
35 
     | 
    
         
             
            class RecursiveTest < TestCase
         
     | 
| 
       36 
     | 
    
         
            -
              def setup
         
     | 
| 
       37 
     | 
    
         
            -
                # Need to use wall time for this test due to the sleep calls
         
     | 
| 
       38 
     | 
    
         
            -
                RubyProf::measure_mode = RubyProf::WALL_TIME
         
     | 
| 
       39 
     | 
    
         
            -
              end
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
36 
     | 
    
         
             
              include SimpleRecursion
         
     | 
| 
       42 
37 
     | 
    
         | 
| 
       43 
38 
     | 
    
         
             
              def test_simple
         
     | 
| 
       44 
     | 
    
         
            -
                result = RubyProf.profile do
         
     | 
| 
      
 39 
     | 
    
         
            +
                result = RubyProf::Profile.profile(measure_mode: RubyProf::WALL_TIME) do
         
     | 
| 
       45 
40 
     | 
    
         
             
                  simple(1)
         
     | 
| 
       46 
41 
     | 
    
         
             
                end
         
     | 
| 
       47 
42 
     | 
    
         | 
| 
       48 
43 
     | 
    
         
             
                methods = result.threads.first.methods.sort.reverse
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
             
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
             
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
       64 
     | 
    
         
            -
             
     | 
| 
       65 
     | 
    
         
            -
             
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
       67 
     | 
    
         
            -
             
     | 
| 
       68 
     | 
    
         
            -
             
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
             
     | 
| 
       71 
     | 
    
         
            -
             
     | 
| 
       72 
     | 
    
         
            -
             
     | 
| 
       73 
     | 
    
         
            -
             
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
       76 
     | 
    
         
            -
             
     | 
| 
       77 
     | 
    
         
            -
             
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
       79 
     | 
    
         
            -
             
     | 
| 
       80 
     | 
    
         
            -
             
     | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
       84 
     | 
    
         
            -
             
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
       86 
     | 
    
         
            -
             
     | 
| 
       87 
     | 
    
         
            -
             
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
       90 
     | 
    
         
            -
             
     | 
| 
       91 
     | 
    
         
            -
             
     | 
| 
       92 
     | 
    
         
            -
             
     | 
| 
       93 
     | 
    
         
            -
             
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
             
     | 
| 
       97 
     | 
    
         
            -
             
     | 
| 
       98 
     | 
    
         
            -
             
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
             
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
     | 
    
         
            -
             
     | 
| 
       104 
     | 
    
         
            -
             
     | 
| 
       105 
     | 
    
         
            -
             
     | 
| 
       106 
     | 
    
         
            -
             
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.1')
         
     | 
| 
      
 46 
     | 
    
         
            +
                  assert_equal(3, methods.length)
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                  # Method 0: RecursiveTest#test_simple
         
     | 
| 
      
 49 
     | 
    
         
            +
                  method = methods[0]
         
     | 
| 
      
 50 
     | 
    
         
            +
                  assert_equal('RecursiveTest#test_simple', method.full_name)
         
     | 
| 
      
 51 
     | 
    
         
            +
                  assert_equal(1, method.called)
         
     | 
| 
      
 52 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 53 
     | 
    
         
            +
                  assert_in_delta(2, method.total_time, 0.1)
         
     | 
| 
      
 54 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.01)
         
     | 
| 
      
 55 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 56 
     | 
    
         
            +
                  assert_in_delta(2, method.children_time, 0.1)
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callers.length)
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callees.length)
         
     | 
| 
      
 61 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 62 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', call_tree.target.full_name)
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                  # Method 1: SimpleRecursion#simple
         
     | 
| 
      
 65 
     | 
    
         
            +
                  method = methods[1]
         
     | 
| 
      
 66 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', method.full_name)
         
     | 
| 
      
 67 
     | 
    
         
            +
                  assert_equal(2, method.called)
         
     | 
| 
      
 68 
     | 
    
         
            +
                  assert(method.recursive?)
         
     | 
| 
      
 69 
     | 
    
         
            +
                  assert_in_delta(2, method.total_time, 0.1)
         
     | 
| 
      
 70 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.1)
         
     | 
| 
      
 71 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.1)
         
     | 
| 
      
 72 
     | 
    
         
            +
                  assert_in_delta(2, method.children_time, 0.1)
         
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
      
 74 
     | 
    
         
            +
                  assert_equal(2, method.call_trees.callers.length)
         
     | 
| 
      
 75 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 76 
     | 
    
         
            +
                  assert_equal('RecursiveTest#test_simple', call_tree.parent.target.full_name)
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[1]
         
     | 
| 
      
 79 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', call_tree.parent.target.full_name)
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                  assert_equal(2, method.call_trees.callees.length)
         
     | 
| 
      
 82 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 83 
     | 
    
         
            +
                  assert_equal('Kernel#sleep', call_tree.target.full_name)
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[1]
         
     | 
| 
      
 86 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', call_tree.target.full_name)
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
                  # Method 2: Kernel#sleep
         
     | 
| 
      
 89 
     | 
    
         
            +
                  method = methods[2]
         
     | 
| 
      
 90 
     | 
    
         
            +
                  assert_equal('Kernel#sleep', method.full_name)
         
     | 
| 
      
 91 
     | 
    
         
            +
                  assert_equal(2, method.called)
         
     | 
| 
      
 92 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 93 
     | 
    
         
            +
             
     | 
| 
      
 94 
     | 
    
         
            +
                  assert_in_delta(2, method.total_time, 0.1)
         
     | 
| 
      
 95 
     | 
    
         
            +
                  assert_in_delta(2, method.self_time, 0.1)
         
     | 
| 
      
 96 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.1)
         
     | 
| 
      
 97 
     | 
    
         
            +
                  assert_in_delta(0, method.children_time, 0.1)
         
     | 
| 
      
 98 
     | 
    
         
            +
             
     | 
| 
      
 99 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callers.length)
         
     | 
| 
      
 100 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 101 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', call_tree.parent.target.full_name)
         
     | 
| 
      
 102 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callees.length)
         
     | 
| 
      
 103 
     | 
    
         
            +
             
     | 
| 
      
 104 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callees.length)
         
     | 
| 
      
 105 
     | 
    
         
            +
                else
         
     | 
| 
      
 106 
     | 
    
         
            +
                  assert_equal(5, methods.length)
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
                  # Method 0: RecursiveTest#test_simple
         
     | 
| 
      
 109 
     | 
    
         
            +
                  method = methods[0]
         
     | 
| 
      
 110 
     | 
    
         
            +
                  assert_equal('RecursiveTest#test_simple', method.full_name)
         
     | 
| 
      
 111 
     | 
    
         
            +
                  assert_equal(1, method.called)
         
     | 
| 
      
 112 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 113 
     | 
    
         
            +
                  assert_in_delta(2, method.total_time, 0.1)
         
     | 
| 
      
 114 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.01)
         
     | 
| 
      
 115 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 116 
     | 
    
         
            +
                  assert_in_delta(2, method.children_time, 0.1)
         
     | 
| 
      
 117 
     | 
    
         
            +
             
     | 
| 
      
 118 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callers.length)
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callees.length)
         
     | 
| 
      
 121 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 122 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', call_tree.target.full_name)
         
     | 
| 
      
 123 
     | 
    
         
            +
             
     | 
| 
      
 124 
     | 
    
         
            +
                  # Method 1: SimpleRecursion#simple
         
     | 
| 
      
 125 
     | 
    
         
            +
                  method = methods[1]
         
     | 
| 
      
 126 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', method.full_name)
         
     | 
| 
      
 127 
     | 
    
         
            +
                  assert_equal(2, method.called)
         
     | 
| 
      
 128 
     | 
    
         
            +
                  assert(method.recursive?)
         
     | 
| 
      
 129 
     | 
    
         
            +
                  assert_in_delta(2, method.total_time, 0.1)
         
     | 
| 
      
 130 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.1)
         
     | 
| 
      
 131 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.1)
         
     | 
| 
      
 132 
     | 
    
         
            +
                  assert_in_delta(2, method.children_time, 0.1)
         
     | 
| 
      
 133 
     | 
    
         
            +
             
     | 
| 
      
 134 
     | 
    
         
            +
                  assert_equal(2, method.call_trees.callers.length)
         
     | 
| 
      
 135 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 136 
     | 
    
         
            +
                  assert_equal('RecursiveTest#test_simple', call_tree.parent.target.full_name)
         
     | 
| 
      
 137 
     | 
    
         
            +
             
     | 
| 
      
 138 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[1]
         
     | 
| 
      
 139 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', call_tree.parent.target.full_name)
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
      
 141 
     | 
    
         
            +
                  assert_equal(4, method.call_trees.callees.length)
         
     | 
| 
      
 142 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 143 
     | 
    
         
            +
                  assert_equal('Kernel#sleep', call_tree.target.full_name)
         
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[1]
         
     | 
| 
      
 146 
     | 
    
         
            +
                  assert_equal('Integer#==', call_tree.target.full_name)
         
     | 
| 
      
 147 
     | 
    
         
            +
             
     | 
| 
      
 148 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[2]
         
     | 
| 
      
 149 
     | 
    
         
            +
                  assert_equal('Integer#-', call_tree.target.full_name)
         
     | 
| 
      
 150 
     | 
    
         
            +
             
     | 
| 
      
 151 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[3]
         
     | 
| 
      
 152 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', call_tree.target.full_name)
         
     | 
| 
      
 153 
     | 
    
         
            +
             
     | 
| 
      
 154 
     | 
    
         
            +
                  # Method 2: Kernel#sleep
         
     | 
| 
      
 155 
     | 
    
         
            +
                  method = methods[2]
         
     | 
| 
      
 156 
     | 
    
         
            +
                  assert_equal('Kernel#sleep', method.full_name)
         
     | 
| 
      
 157 
     | 
    
         
            +
                  assert_equal(2, method.called)
         
     | 
| 
      
 158 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 159 
     | 
    
         
            +
             
     | 
| 
      
 160 
     | 
    
         
            +
                  assert_in_delta(2, method.total_time, 0.1)
         
     | 
| 
      
 161 
     | 
    
         
            +
                  assert_in_delta(2, method.self_time, 0.1)
         
     | 
| 
      
 162 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.1)
         
     | 
| 
      
 163 
     | 
    
         
            +
                  assert_in_delta(0, method.children_time, 0.1)
         
     | 
| 
      
 164 
     | 
    
         
            +
             
     | 
| 
      
 165 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callers.length)
         
     | 
| 
      
 166 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 167 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', call_tree.parent.target.full_name)
         
     | 
| 
      
 168 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callees.length)
         
     | 
| 
      
 169 
     | 
    
         
            +
             
     | 
| 
      
 170 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callees.length)
         
     | 
| 
      
 171 
     | 
    
         
            +
             
     | 
| 
      
 172 
     | 
    
         
            +
                  # Method 3
         
     | 
| 
      
 173 
     | 
    
         
            +
                  method = methods[3]
         
     | 
| 
      
 174 
     | 
    
         
            +
                  assert_equal('Integer#==', method.full_name)
         
     | 
| 
      
 175 
     | 
    
         
            +
                  assert_equal(2, method.called)
         
     | 
| 
      
 176 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 177 
     | 
    
         
            +
             
     | 
| 
      
 178 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callers.length)
         
     | 
| 
      
 179 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 180 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', call_tree.parent.target.full_name)
         
     | 
| 
      
 181 
     | 
    
         
            +
             
     | 
| 
      
 182 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callees.length)
         
     | 
| 
      
 183 
     | 
    
         
            +
             
     | 
| 
      
 184 
     | 
    
         
            +
                  # Method 4
         
     | 
| 
      
 185 
     | 
    
         
            +
                  method = methods[4]
         
     | 
| 
      
 186 
     | 
    
         
            +
                  assert_equal('Integer#-', method.full_name)
         
     | 
| 
      
 187 
     | 
    
         
            +
                  assert_equal(1, method.called)
         
     | 
| 
      
 188 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 189 
     | 
    
         
            +
             
     | 
| 
      
 190 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callers.length)
         
     | 
| 
      
 191 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 192 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#simple', call_tree.parent.target.full_name)
         
     | 
| 
      
 193 
     | 
    
         
            +
             
     | 
| 
      
 194 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callees.length)
         
     | 
| 
      
 195 
     | 
    
         
            +
                end
         
     | 
| 
       107 
196 
     | 
    
         
             
              end
         
     | 
| 
       108 
197 
     | 
    
         | 
| 
       109 
198 
     | 
    
         
             
              def test_cycle
         
     | 
| 
       110 
     | 
    
         
            -
                result = RubyProf.profile do
         
     | 
| 
      
 199 
     | 
    
         
            +
                result = RubyProf::Profile.profile(measure_mode: RubyProf::WALL_TIME) do
         
     | 
| 
       111 
200 
     | 
    
         
             
                  render
         
     | 
| 
       112 
201 
     | 
    
         
             
                end
         
     | 
| 
       113 
202 
     | 
    
         | 
| 
       114 
203 
     | 
    
         
             
                methods = result.threads.first.methods.sort.reverse
         
     | 
| 
       115 
     | 
    
         
            -
             
     | 
| 
       116 
     | 
    
         
            -
             
     | 
| 
       117 
     | 
    
         
            -
             
     | 
| 
       118 
     | 
    
         
            -
             
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
             
     | 
| 
       121 
     | 
    
         
            -
             
     | 
| 
       122 
     | 
    
         
            -
             
     | 
| 
       123 
     | 
    
         
            -
             
     | 
| 
       124 
     | 
    
         
            -
             
     | 
| 
       125 
     | 
    
         
            -
             
     | 
| 
       126 
     | 
    
         
            -
             
     | 
| 
       127 
     | 
    
         
            -
             
     | 
| 
       128 
     | 
    
         
            -
             
     | 
| 
       129 
     | 
    
         
            -
             
     | 
| 
       130 
     | 
    
         
            -
             
     | 
| 
       131 
     | 
    
         
            -
             
     | 
| 
       132 
     | 
    
         
            -
             
     | 
| 
       133 
     | 
    
         
            -
             
     | 
| 
       134 
     | 
    
         
            -
             
     | 
| 
       135 
     | 
    
         
            -
             
     | 
| 
       136 
     | 
    
         
            -
             
     | 
| 
       137 
     | 
    
         
            -
             
     | 
| 
       138 
     | 
    
         
            -
             
     | 
| 
       139 
     | 
    
         
            -
             
     | 
| 
       140 
     | 
    
         
            -
             
     | 
| 
       141 
     | 
    
         
            -
             
     | 
| 
       142 
     | 
    
         
            -
             
     | 
| 
       143 
     | 
    
         
            -
             
     | 
| 
       144 
     | 
    
         
            -
             
     | 
| 
       145 
     | 
    
         
            -
             
     | 
| 
       146 
     | 
    
         
            -
             
     | 
| 
       147 
     | 
    
         
            -
             
     | 
| 
       148 
     | 
    
         
            -
             
     | 
| 
       149 
     | 
    
         
            -
             
     | 
| 
       150 
     | 
    
         
            -
             
     | 
| 
       151 
     | 
    
         
            -
             
     | 
| 
       152 
     | 
    
         
            -
             
     | 
| 
       153 
     | 
    
         
            -
             
     | 
| 
       154 
     | 
    
         
            -
             
     | 
| 
       155 
     | 
    
         
            -
             
     | 
| 
       156 
     | 
    
         
            -
             
     | 
| 
       157 
     | 
    
         
            -
             
     | 
| 
       158 
     | 
    
         
            -
             
     | 
| 
       159 
     | 
    
         
            -
             
     | 
| 
       160 
     | 
    
         
            -
             
     | 
| 
       161 
     | 
    
         
            -
             
     | 
| 
       162 
     | 
    
         
            -
             
     | 
| 
       163 
     | 
    
         
            -
             
     | 
| 
       164 
     | 
    
         
            -
             
     | 
| 
       165 
     | 
    
         
            -
             
     | 
| 
       166 
     | 
    
         
            -
             
     | 
| 
       167 
     | 
    
         
            -
             
     | 
| 
       168 
     | 
    
         
            -
             
     | 
| 
       169 
     | 
    
         
            -
             
     | 
| 
       170 
     | 
    
         
            -
             
     | 
| 
       171 
     | 
    
         
            -
             
     | 
| 
       172 
     | 
    
         
            -
             
     | 
| 
       173 
     | 
    
         
            -
             
     | 
| 
       174 
     | 
    
         
            -
             
     | 
| 
       175 
     | 
    
         
            -
             
     | 
| 
       176 
     | 
    
         
            -
             
     | 
| 
       177 
     | 
    
         
            -
             
     | 
| 
       178 
     | 
    
         
            -
             
     | 
| 
       179 
     | 
    
         
            -
             
     | 
| 
       180 
     | 
    
         
            -
             
     | 
| 
       181 
     | 
    
         
            -
             
     | 
| 
       182 
     | 
    
         
            -
             
     | 
| 
       183 
     | 
    
         
            -
             
     | 
| 
       184 
     | 
    
         
            -
             
     | 
| 
       185 
     | 
    
         
            -
             
     | 
| 
       186 
     | 
    
         
            -
             
     | 
| 
       187 
     | 
    
         
            -
             
     | 
| 
       188 
     | 
    
         
            -
             
     | 
| 
       189 
     | 
    
         
            -
             
     | 
| 
       190 
     | 
    
         
            -
             
     | 
| 
       191 
     | 
    
         
            -
             
     | 
| 
       192 
     | 
    
         
            -
             
     | 
| 
       193 
     | 
    
         
            -
             
     | 
| 
       194 
     | 
    
         
            -
             
     | 
| 
       195 
     | 
    
         
            -
             
     | 
| 
       196 
     | 
    
         
            -
             
     | 
| 
       197 
     | 
    
         
            -
             
     | 
| 
       198 
     | 
    
         
            -
             
     | 
| 
       199 
     | 
    
         
            -
             
     | 
| 
       200 
     | 
    
         
            -
             
     | 
| 
       201 
     | 
    
         
            -
             
     | 
| 
       202 
     | 
    
         
            -
             
     | 
| 
       203 
     | 
    
         
            -
             
     | 
| 
       204 
     | 
    
         
            -
             
     | 
| 
      
 204 
     | 
    
         
            +
             
     | 
| 
      
 205 
     | 
    
         
            +
                if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.1')
         
     | 
| 
      
 206 
     | 
    
         
            +
                  assert_equal(5, methods.length)
         
     | 
| 
      
 207 
     | 
    
         
            +
             
     | 
| 
      
 208 
     | 
    
         
            +
                  # Method 0
         
     | 
| 
      
 209 
     | 
    
         
            +
                  method = methods[0]
         
     | 
| 
      
 210 
     | 
    
         
            +
                  assert_equal('RecursiveTest#test_cycle', method.full_name)
         
     | 
| 
      
 211 
     | 
    
         
            +
                  assert_equal(1, method.called)
         
     | 
| 
      
 212 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 213 
     | 
    
         
            +
                  assert_in_delta(5, method.total_time, 0.1)
         
     | 
| 
      
 214 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.01)
         
     | 
| 
      
 215 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 216 
     | 
    
         
            +
                  assert_in_delta(5, method.children_time, 0.1)
         
     | 
| 
      
 217 
     | 
    
         
            +
             
     | 
| 
      
 218 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callers.length)
         
     | 
| 
      
 219 
     | 
    
         
            +
             
     | 
| 
      
 220 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callees.length)
         
     | 
| 
      
 221 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 222 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render', call_tree.target.full_name)
         
     | 
| 
      
 223 
     | 
    
         
            +
             
     | 
| 
      
 224 
     | 
    
         
            +
                  # Method 1
         
     | 
| 
      
 225 
     | 
    
         
            +
                  method = methods[1]
         
     | 
| 
      
 226 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render', method.full_name)
         
     | 
| 
      
 227 
     | 
    
         
            +
                  assert_equal(1, method.called)
         
     | 
| 
      
 228 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 229 
     | 
    
         
            +
                  assert_in_delta(5, method.total_time, 0.1)
         
     | 
| 
      
 230 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.01)
         
     | 
| 
      
 231 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 232 
     | 
    
         
            +
                  assert_in_delta(5, method.children_time, 0.1)
         
     | 
| 
      
 233 
     | 
    
         
            +
             
     | 
| 
      
 234 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callers.length)
         
     | 
| 
      
 235 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 236 
     | 
    
         
            +
                  assert_equal('RecursiveTest#test_cycle', call_tree.parent.target.full_name)
         
     | 
| 
      
 237 
     | 
    
         
            +
             
     | 
| 
      
 238 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callees.length)
         
     | 
| 
      
 239 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 240 
     | 
    
         
            +
                  assert_equal('Integer#times', call_tree.target.full_name)
         
     | 
| 
      
 241 
     | 
    
         
            +
             
     | 
| 
      
 242 
     | 
    
         
            +
                  # Method 2
         
     | 
| 
      
 243 
     | 
    
         
            +
                  method = methods[2]
         
     | 
| 
      
 244 
     | 
    
         
            +
                  assert_equal('Integer#times', method.full_name)
         
     | 
| 
      
 245 
     | 
    
         
            +
                  assert_equal(2, method.called)
         
     | 
| 
      
 246 
     | 
    
         
            +
                  assert(method.recursive?)
         
     | 
| 
      
 247 
     | 
    
         
            +
                  assert_in_delta(5, method.total_time, 0.1)
         
     | 
| 
      
 248 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.1)
         
     | 
| 
      
 249 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.1)
         
     | 
| 
      
 250 
     | 
    
         
            +
                  assert_in_delta(5, method.children_time, 0.1)
         
     | 
| 
      
 251 
     | 
    
         
            +
             
     | 
| 
      
 252 
     | 
    
         
            +
                  assert_equal(2, method.call_trees.callers.length)
         
     | 
| 
      
 253 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 254 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render', call_tree.parent.target.full_name)
         
     | 
| 
      
 255 
     | 
    
         
            +
             
     | 
| 
      
 256 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[1]
         
     | 
| 
      
 257 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', call_tree.parent.target.full_name)
         
     | 
| 
      
 258 
     | 
    
         
            +
             
     | 
| 
      
 259 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callees.length)
         
     | 
| 
      
 260 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 261 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', call_tree.target.full_name)
         
     | 
| 
      
 262 
     | 
    
         
            +
             
     | 
| 
      
 263 
     | 
    
         
            +
                  # Method 3
         
     | 
| 
      
 264 
     | 
    
         
            +
                  method = methods[3]
         
     | 
| 
      
 265 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', method.full_name)
         
     | 
| 
      
 266 
     | 
    
         
            +
                  assert_equal(5, method.called)
         
     | 
| 
      
 267 
     | 
    
         
            +
                  assert(method.recursive?)
         
     | 
| 
      
 268 
     | 
    
         
            +
                  assert_in_delta(5, method.total_time, 0.1)
         
     | 
| 
      
 269 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.1)
         
     | 
| 
      
 270 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 271 
     | 
    
         
            +
                  assert_in_delta(5, method.children_time, 0.05)
         
     | 
| 
      
 272 
     | 
    
         
            +
             
     | 
| 
      
 273 
     | 
    
         
            +
                  assert_equal(2, method.call_trees.callers.length)
         
     | 
| 
      
 274 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 275 
     | 
    
         
            +
                  assert_equal('Integer#times', call_tree.parent.target.full_name)
         
     | 
| 
      
 276 
     | 
    
         
            +
             
     | 
| 
      
 277 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[1]
         
     | 
| 
      
 278 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', call_tree.parent.target.full_name)
         
     | 
| 
      
 279 
     | 
    
         
            +
             
     | 
| 
      
 280 
     | 
    
         
            +
                  assert_equal(3, method.call_trees.callees.length)
         
     | 
| 
      
 281 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 282 
     | 
    
         
            +
                  assert_equal('Kernel#sleep', call_tree.target.full_name)
         
     | 
| 
      
 283 
     | 
    
         
            +
             
     | 
| 
      
 284 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[1]
         
     | 
| 
      
 285 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', call_tree.target.full_name)
         
     | 
| 
      
 286 
     | 
    
         
            +
             
     | 
| 
      
 287 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[2]
         
     | 
| 
      
 288 
     | 
    
         
            +
                  assert_equal('Integer#times', call_tree.target.full_name)
         
     | 
| 
      
 289 
     | 
    
         
            +
             
     | 
| 
      
 290 
     | 
    
         
            +
                  # Method 4
         
     | 
| 
      
 291 
     | 
    
         
            +
                  method = methods[4]
         
     | 
| 
      
 292 
     | 
    
         
            +
                  assert_equal('Kernel#sleep', method.full_name)
         
     | 
| 
      
 293 
     | 
    
         
            +
                  assert_equal(5, method.called)
         
     | 
| 
      
 294 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 295 
     | 
    
         
            +
                  assert_in_delta(5, method.total_time, 0.1)
         
     | 
| 
      
 296 
     | 
    
         
            +
                  assert_in_delta(5, method.self_time, 0.1)
         
     | 
| 
      
 297 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 298 
     | 
    
         
            +
                  assert_in_delta(0, method.children_time, 0.01)
         
     | 
| 
      
 299 
     | 
    
         
            +
             
     | 
| 
      
 300 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callers.length)
         
     | 
| 
      
 301 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 302 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', call_tree.parent.target.full_name)
         
     | 
| 
      
 303 
     | 
    
         
            +
             
     | 
| 
      
 304 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callees.length)
         
     | 
| 
      
 305 
     | 
    
         
            +
                else
         
     | 
| 
      
 306 
     | 
    
         
            +
                  assert_equal(6, methods.length)
         
     | 
| 
      
 307 
     | 
    
         
            +
             
     | 
| 
      
 308 
     | 
    
         
            +
                  # Method 0
         
     | 
| 
      
 309 
     | 
    
         
            +
                  method = methods[0]
         
     | 
| 
      
 310 
     | 
    
         
            +
                  assert_equal('RecursiveTest#test_cycle', method.full_name)
         
     | 
| 
      
 311 
     | 
    
         
            +
                  assert_equal(1, method.called)
         
     | 
| 
      
 312 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 313 
     | 
    
         
            +
                  assert_in_delta(5, method.total_time, 0.1)
         
     | 
| 
      
 314 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.01)
         
     | 
| 
      
 315 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 316 
     | 
    
         
            +
                  assert_in_delta(5, method.children_time, 0.1)
         
     | 
| 
      
 317 
     | 
    
         
            +
             
     | 
| 
      
 318 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callers.length)
         
     | 
| 
      
 319 
     | 
    
         
            +
             
     | 
| 
      
 320 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callees.length)
         
     | 
| 
      
 321 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 322 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render', call_tree.target.full_name)
         
     | 
| 
      
 323 
     | 
    
         
            +
             
     | 
| 
      
 324 
     | 
    
         
            +
                  # Method 1
         
     | 
| 
      
 325 
     | 
    
         
            +
                  method = methods[1]
         
     | 
| 
      
 326 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render', method.full_name)
         
     | 
| 
      
 327 
     | 
    
         
            +
                  assert_equal(1, method.called)
         
     | 
| 
      
 328 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 329 
     | 
    
         
            +
                  assert_in_delta(5, method.total_time, 0.1)
         
     | 
| 
      
 330 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.01)
         
     | 
| 
      
 331 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 332 
     | 
    
         
            +
                  assert_in_delta(5, method.children_time, 0.1)
         
     | 
| 
      
 333 
     | 
    
         
            +
             
     | 
| 
      
 334 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callers.length)
         
     | 
| 
      
 335 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 336 
     | 
    
         
            +
                  assert_equal('RecursiveTest#test_cycle', call_tree.parent.target.full_name)
         
     | 
| 
      
 337 
     | 
    
         
            +
             
     | 
| 
      
 338 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callees.length)
         
     | 
| 
      
 339 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 340 
     | 
    
         
            +
                  assert_equal('Integer#times', call_tree.target.full_name)
         
     | 
| 
      
 341 
     | 
    
         
            +
             
     | 
| 
      
 342 
     | 
    
         
            +
                  # Method 2
         
     | 
| 
      
 343 
     | 
    
         
            +
                  method = methods[2]
         
     | 
| 
      
 344 
     | 
    
         
            +
                  assert_equal('Integer#times', method.full_name)
         
     | 
| 
      
 345 
     | 
    
         
            +
                  assert_equal(2, method.called)
         
     | 
| 
      
 346 
     | 
    
         
            +
                  assert(method.recursive?)
         
     | 
| 
      
 347 
     | 
    
         
            +
                  assert_in_delta(5, method.total_time, 0.1)
         
     | 
| 
      
 348 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.1)
         
     | 
| 
      
 349 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.1)
         
     | 
| 
      
 350 
     | 
    
         
            +
                  assert_in_delta(5, method.children_time, 0.1)
         
     | 
| 
      
 351 
     | 
    
         
            +
             
     | 
| 
      
 352 
     | 
    
         
            +
                  assert_equal(2, method.call_trees.callers.length)
         
     | 
| 
      
 353 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 354 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render', call_tree.parent.target.full_name)
         
     | 
| 
      
 355 
     | 
    
         
            +
             
     | 
| 
      
 356 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[1]
         
     | 
| 
      
 357 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', call_tree.parent.target.full_name)
         
     | 
| 
      
 358 
     | 
    
         
            +
             
     | 
| 
      
 359 
     | 
    
         
            +
                  assert_equal(2, method.call_trees.callees.length)
         
     | 
| 
      
 360 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 361 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', call_tree.target.full_name)
         
     | 
| 
      
 362 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[1]
         
     | 
| 
      
 363 
     | 
    
         
            +
                  assert_equal('Integer#+', call_tree.target.full_name)
         
     | 
| 
      
 364 
     | 
    
         
            +
             
     | 
| 
      
 365 
     | 
    
         
            +
                  # Method 3
         
     | 
| 
      
 366 
     | 
    
         
            +
                  method = methods[3]
         
     | 
| 
      
 367 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', method.full_name)
         
     | 
| 
      
 368 
     | 
    
         
            +
                  assert_equal(5, method.called)
         
     | 
| 
      
 369 
     | 
    
         
            +
                  assert(method.recursive?)
         
     | 
| 
      
 370 
     | 
    
         
            +
                  assert_in_delta(5, method.total_time, 0.1)
         
     | 
| 
      
 371 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.1)
         
     | 
| 
      
 372 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 373 
     | 
    
         
            +
                  assert_in_delta(5, method.children_time, 0.1)
         
     | 
| 
      
 374 
     | 
    
         
            +
             
     | 
| 
      
 375 
     | 
    
         
            +
                  assert_equal(2, method.call_trees.callers.length)
         
     | 
| 
      
 376 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 377 
     | 
    
         
            +
                  assert_equal('Integer#times', call_tree.parent.target.full_name)
         
     | 
| 
      
 378 
     | 
    
         
            +
             
     | 
| 
      
 379 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[1]
         
     | 
| 
      
 380 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', call_tree.parent.target.full_name)
         
     | 
| 
      
 381 
     | 
    
         
            +
             
     | 
| 
      
 382 
     | 
    
         
            +
                  assert_equal(3, method.call_trees.callees.length)
         
     | 
| 
      
 383 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[0]
         
     | 
| 
      
 384 
     | 
    
         
            +
                  assert_equal('Kernel#sleep', call_tree.target.full_name)
         
     | 
| 
      
 385 
     | 
    
         
            +
             
     | 
| 
      
 386 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[1]
         
     | 
| 
      
 387 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', call_tree.target.full_name)
         
     | 
| 
      
 388 
     | 
    
         
            +
             
     | 
| 
      
 389 
     | 
    
         
            +
                  call_tree = method.call_trees.callees[2]
         
     | 
| 
      
 390 
     | 
    
         
            +
                  assert_equal('Integer#times', call_tree.target.full_name)
         
     | 
| 
      
 391 
     | 
    
         
            +
             
     | 
| 
      
 392 
     | 
    
         
            +
                  # Method 4
         
     | 
| 
      
 393 
     | 
    
         
            +
                  method = methods[4]
         
     | 
| 
      
 394 
     | 
    
         
            +
                  assert_equal('Kernel#sleep', method.full_name)
         
     | 
| 
      
 395 
     | 
    
         
            +
                  assert_equal(5, method.called)
         
     | 
| 
      
 396 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 397 
     | 
    
         
            +
                  assert_in_delta(5, method.total_time, 0.1)
         
     | 
| 
      
 398 
     | 
    
         
            +
                  assert_in_delta(5, method.self_time, 0.1)
         
     | 
| 
      
 399 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 400 
     | 
    
         
            +
                  assert_in_delta(0, method.children_time, 0.01)
         
     | 
| 
      
 401 
     | 
    
         
            +
             
     | 
| 
      
 402 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callers.length)
         
     | 
| 
      
 403 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 404 
     | 
    
         
            +
                  assert_equal('SimpleRecursion#render_partial', call_tree.parent.target.full_name)
         
     | 
| 
      
 405 
     | 
    
         
            +
             
     | 
| 
      
 406 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callees.length)
         
     | 
| 
      
 407 
     | 
    
         
            +
             
     | 
| 
      
 408 
     | 
    
         
            +
                  # Method 5
         
     | 
| 
      
 409 
     | 
    
         
            +
                  method = methods[5]
         
     | 
| 
      
 410 
     | 
    
         
            +
                  assert_equal('Integer#+', method.full_name)
         
     | 
| 
      
 411 
     | 
    
         
            +
                  assert_equal(2, method.called)
         
     | 
| 
      
 412 
     | 
    
         
            +
                  refute(method.recursive?)
         
     | 
| 
      
 413 
     | 
    
         
            +
                  assert_in_delta(0, method.total_time, 0.1)
         
     | 
| 
      
 414 
     | 
    
         
            +
                  assert_in_delta(0, method.self_time, 0.1)
         
     | 
| 
      
 415 
     | 
    
         
            +
                  assert_in_delta(0, method.wait_time, 0.01)
         
     | 
| 
      
 416 
     | 
    
         
            +
                  assert_in_delta(0, method.children_time, 0.01)
         
     | 
| 
      
 417 
     | 
    
         
            +
             
     | 
| 
      
 418 
     | 
    
         
            +
                  assert_equal(1, method.call_trees.callers.length)
         
     | 
| 
      
 419 
     | 
    
         
            +
                  call_tree = method.call_trees.callers[0]
         
     | 
| 
      
 420 
     | 
    
         
            +
                  assert_equal('Integer#times', call_tree.parent.target.full_name)
         
     | 
| 
      
 421 
     | 
    
         
            +
             
     | 
| 
      
 422 
     | 
    
         
            +
                  assert_equal(0, method.call_trees.callees.length)
         
     | 
| 
      
 423 
     | 
    
         
            +
                end
         
     | 
| 
       205 
424 
     | 
    
         
             
              end
         
     | 
| 
       206 
425 
     | 
    
         
             
            end
         
     |