ruby-prof 1.1.0-x64-mingw32 → 1.3.0-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +19 -1
  3. data/bin/ruby-prof +100 -152
  4. data/ext/ruby_prof/rp_aggregate_call_tree.c +59 -0
  5. data/ext/ruby_prof/rp_aggregate_call_tree.h +13 -0
  6. data/ext/ruby_prof/rp_allocation.c +67 -59
  7. data/ext/ruby_prof/rp_allocation.h +3 -3
  8. data/ext/ruby_prof/rp_call_tree.c +369 -0
  9. data/ext/ruby_prof/rp_call_tree.h +43 -0
  10. data/ext/ruby_prof/rp_call_trees.c +288 -0
  11. data/ext/ruby_prof/rp_call_trees.h +28 -0
  12. data/ext/ruby_prof/rp_measure_allocations.c +11 -13
  13. data/ext/ruby_prof/rp_measure_process_time.c +11 -13
  14. data/ext/ruby_prof/rp_measure_wall_time.c +17 -15
  15. data/ext/ruby_prof/rp_measurement.c +47 -40
  16. data/ext/ruby_prof/rp_measurement.h +7 -7
  17. data/ext/ruby_prof/rp_method.c +116 -255
  18. data/ext/ruby_prof/rp_method.h +31 -39
  19. data/ext/ruby_prof/rp_profile.c +311 -281
  20. data/ext/ruby_prof/rp_profile.h +1 -2
  21. data/ext/ruby_prof/rp_stack.c +113 -105
  22. data/ext/ruby_prof/rp_stack.h +17 -20
  23. data/ext/ruby_prof/rp_thread.c +136 -111
  24. data/ext/ruby_prof/rp_thread.h +12 -9
  25. data/ext/ruby_prof/ruby_prof.c +27 -23
  26. data/ext/ruby_prof/ruby_prof.h +9 -0
  27. data/ext/ruby_prof/vc/ruby_prof.vcxproj +11 -7
  28. data/lib/ruby-prof.rb +2 -3
  29. data/lib/ruby-prof/assets/call_stack_printer.html.erb +4 -7
  30. data/lib/ruby-prof/assets/graph_printer.html.erb +5 -6
  31. data/lib/ruby-prof/{call_info.rb → call_tree.rb} +6 -6
  32. data/lib/ruby-prof/call_tree_visitor.rb +36 -0
  33. data/lib/ruby-prof/measurement.rb +5 -2
  34. data/lib/ruby-prof/method_info.rb +3 -15
  35. data/lib/ruby-prof/printers/call_info_printer.rb +12 -10
  36. data/lib/ruby-prof/printers/call_stack_printer.rb +19 -22
  37. data/lib/ruby-prof/printers/call_tree_printer.rb +1 -1
  38. data/lib/ruby-prof/printers/dot_printer.rb +3 -3
  39. data/lib/ruby-prof/printers/graph_printer.rb +3 -4
  40. data/lib/ruby-prof/printers/multi_printer.rb +2 -2
  41. data/lib/ruby-prof/rack.rb +3 -0
  42. data/lib/ruby-prof/thread.rb +3 -18
  43. data/lib/ruby-prof/version.rb +1 -1
  44. data/ruby-prof.gemspec +7 -0
  45. data/test/alias_test.rb +42 -45
  46. data/test/basic_test.rb +0 -86
  47. data/test/{call_info_visitor_test.rb → call_tree_visitor_test.rb} +6 -5
  48. data/test/call_trees_test.rb +66 -0
  49. data/test/exclude_methods_test.rb +17 -12
  50. data/test/fiber_test.rb +197 -9
  51. data/test/gc_test.rb +36 -42
  52. data/test/inverse_call_tree_test.rb +175 -0
  53. data/test/line_number_test.rb +67 -70
  54. data/test/marshal_test.rb +7 -11
  55. data/test/measure_allocations_test.rb +224 -234
  56. data/test/measure_allocations_trace_test.rb +224 -234
  57. data/test/measure_memory_trace_test.rb +814 -469
  58. data/test/measure_process_time_test.rb +0 -64
  59. data/test/measure_times.rb +2 -0
  60. data/test/measure_wall_time_test.rb +34 -58
  61. data/test/pause_resume_test.rb +19 -10
  62. data/test/prime.rb +1 -3
  63. data/test/prime_script.rb +6 -0
  64. data/test/printers_test.rb +1 -1
  65. data/test/recursive_test.rb +50 -54
  66. data/test/start_stop_test.rb +19 -19
  67. data/test/test_helper.rb +3 -15
  68. data/test/thread_test.rb +11 -11
  69. data/test/unique_call_path_test.rb +25 -95
  70. metadata +19 -10
  71. data/ext/ruby_prof/rp_call_info.c +0 -271
  72. data/ext/ruby_prof/rp_call_info.h +0 -35
  73. data/lib/2.6.5/ruby_prof.so +0 -0
  74. data/lib/ruby-prof/call_info_visitor.rb +0 -38
  75. data/test/parser_timings.rb +0 -24
@@ -6,25 +6,25 @@ require File.expand_path('../test_helper', __FILE__)
6
6
  class LineNumbers
7
7
  def method_1
8
8
  method_2
9
- filler = 1
9
+ _filler = 1
10
10
  method_3
11
11
  end
12
12
 
13
13
  def method_2
14
- filler = 1
14
+ _filler = 1
15
15
  2.times do |i|
16
- filler = 2
16
+ _filler = 2
17
17
  method_3
18
18
  end
19
19
  end
20
20
 
21
21
  def method_3
22
- sleep(0.4)
22
+ sleep(0.3)
23
23
  method_4
24
24
  end
25
25
 
26
26
  def method_4
27
- sleep(1)
27
+ sleep(1.2)
28
28
  end
29
29
  end
30
30
 
@@ -45,117 +45,114 @@ class LineNumbersTest < TestCase
45
45
  assert_equal('LineNumbersTest#test_function_line_no', method.full_name)
46
46
  assert_equal(37, method.line)
47
47
 
48
- assert_equal(1, method.callers.count)
49
- call_info = method.callers[0]
50
- assert_nil(call_info.parent)
51
- assert_equal(37, call_info.line)
48
+ assert_equal(0, method.call_trees.callers.count)
52
49
 
53
- assert_equal(1, method.callees.count)
54
- call_info = method.callees[0]
55
- assert_equal('LineNumbers#method_1', call_info.target.full_name)
56
- assert_equal(37, call_info.line)
50
+ assert_equal(1, method.call_trees.callees.count)
51
+ call_tree = method.call_trees.callees[0]
52
+ assert_equal('LineNumbers#method_1', call_tree.target.full_name)
53
+ assert_equal(37, call_tree.line)
57
54
 
58
55
  # Method 1
59
56
  method = methods[1]
60
57
  assert_equal('LineNumbers#method_1', method.full_name)
61
58
  assert_equal(7, method.line)
62
59
 
63
- assert_equal(1, method.callers.count)
64
- call_info = method.callers[0]
65
- assert_equal('LineNumbersTest#test_function_line_no', call_info.parent.full_name)
66
- assert_equal(37, call_info.line)
60
+ assert_equal(1, method.call_trees.callers.count)
61
+ call_tree = method.call_trees.callers[0]
62
+ assert_equal('LineNumbersTest#test_function_line_no', call_tree.parent.target.full_name)
63
+ assert_equal(37, call_tree.line)
67
64
 
68
- assert_equal(2, method.callees.count)
69
- call_info = method.callees[0]
70
- assert_equal('LineNumbers#method_2', call_info.target.full_name)
71
- assert_equal(8, call_info.line)
65
+ assert_equal(2, method.call_trees.callees.count)
66
+ call_tree = method.call_trees.callees[0]
67
+ assert_equal('LineNumbers#method_2', call_tree.target.full_name)
68
+ assert_equal(8, call_tree.line)
72
69
 
73
- call_info = method.callees[1]
74
- assert_equal('LineNumbers#method_3', call_info.target.full_name)
75
- assert_equal(10, call_info.line)
70
+ call_tree = method.call_trees.callees[1]
71
+ assert_equal('LineNumbers#method_3', call_tree.target.full_name)
72
+ assert_equal(10, call_tree.line)
76
73
 
77
74
  # Method 2
78
75
  method = methods[2]
79
76
  assert_equal('LineNumbers#method_3', method.full_name)
80
77
  assert_equal(21, method.line)
81
78
 
82
- assert_equal(2, method.callers.count)
83
- call_info = method.callers[0]
84
- assert_equal('Integer#times', call_info.parent.full_name)
85
- assert_equal(17, call_info.line)
79
+ assert_equal(2, method.call_trees.callers.count)
80
+ call_tree = method.call_trees.callers[0]
81
+ assert_equal('Integer#times', call_tree.parent.target.full_name)
82
+ assert_equal(17, call_tree.line)
86
83
 
87
- call_info = method.callers[1]
88
- assert_equal('LineNumbers#method_1', call_info.parent.full_name)
89
- assert_equal(10, call_info.line)
84
+ call_tree = method.call_trees.callers[1]
85
+ assert_equal('LineNumbers#method_1', call_tree.parent.target.full_name)
86
+ assert_equal(10, call_tree.line)
90
87
 
91
- assert_equal(2, method.callees.count)
92
- call_info = method.callees[0]
93
- assert_equal('Kernel#sleep', call_info.target.full_name)
94
- assert_equal(22, call_info.line)
88
+ assert_equal(2, method.call_trees.callees.count)
89
+ call_tree = method.call_trees.callees[0]
90
+ assert_equal('Kernel#sleep', call_tree.target.full_name)
91
+ assert_equal(22, call_tree.line)
95
92
 
96
- call_info = method.callees[1]
97
- assert_equal('LineNumbers#method_4', call_info.target.full_name)
98
- assert_equal(23, call_info.line)
93
+ call_tree = method.call_trees.callees[1]
94
+ assert_equal('LineNumbers#method_4', call_tree.target.full_name)
95
+ assert_equal(23, call_tree.line)
99
96
 
100
97
  # Method 3
101
98
  method = methods[3]
102
99
  assert_equal('Kernel#sleep', method.full_name)
103
100
  assert_equal(0, method.line)
104
101
 
105
- assert_equal(2, method.callers.count)
106
- call_info = method.callers[0]
107
- assert_equal('LineNumbers#method_3', call_info.parent.full_name)
108
- assert_equal(22, call_info.line)
102
+ assert_equal(2, method.call_trees.callers.count)
103
+ call_tree = method.call_trees.callers[0]
104
+ assert_equal('LineNumbers#method_3', call_tree.parent.target.full_name)
105
+ assert_equal(22, call_tree.line)
109
106
 
110
- call_info = method.callers[1]
111
- assert_equal('LineNumbers#method_4', call_info.parent.full_name)
112
- assert_equal(27, call_info.line)
107
+ call_tree = method.call_trees.callers[1]
108
+ assert_equal('LineNumbers#method_4', call_tree.parent.target.full_name)
109
+ assert_equal(27, call_tree.line)
113
110
 
114
- assert_equal(0, method.callees.count)
111
+ assert_equal(0, method.call_trees.callees.count)
115
112
 
116
113
  # Method 4
117
114
  method = methods[4]
118
115
  assert_equal('LineNumbers#method_4', method.full_name)
119
116
  assert_equal(26, method.line)
120
117
 
121
- assert_equal(1, method.callers.count)
122
- call_info = method.callers[0]
123
- assert_equal('LineNumbers#method_3', call_info.parent.full_name)
124
- assert_equal(23, call_info.line)
118
+ assert_equal(1, method.call_trees.callers.count)
119
+ call_tree = method.call_trees.callers[0]
120
+ assert_equal('LineNumbers#method_3', call_tree.parent.target.full_name)
121
+ assert_equal(23, call_tree.line)
125
122
 
126
- assert_equal(1, method.callees.count)
127
- call_info = method.callees[0]
128
- assert_equal('Kernel#sleep', call_info.target.full_name)
129
- assert_equal(27, call_info.line)
123
+ assert_equal(1, method.call_trees.callees.count)
124
+ call_tree = method.call_trees.callees[0]
125
+ assert_equal('Kernel#sleep', call_tree.target.full_name)
126
+ assert_equal(27, call_tree.line)
130
127
 
131
128
  # Method 5
132
129
  method = methods[5]
133
130
  assert_equal('LineNumbers#method_2', method.full_name)
134
131
  assert_equal(13, method.line)
135
132
 
136
- assert_equal(1, method.callers.count)
137
- call_info = method.callers[0]
138
- assert_equal('LineNumbers#method_1', call_info.parent.full_name)
139
- assert_equal(8, call_info.line)
133
+ assert_equal(1, method.call_trees.callers.count)
134
+ call_tree = method.call_trees.callers[0]
135
+ assert_equal('LineNumbers#method_1', call_tree.parent.target.full_name)
136
+ assert_equal(8, call_tree.line)
140
137
 
141
- assert_equal(1, method.callees.count)
142
- call_info = method.callees[0]
143
- assert_equal('Integer#times', call_info.target.full_name)
144
- assert_equal(15, call_info.line)
138
+ assert_equal(1, method.call_trees.callees.count)
139
+ call_tree = method.call_trees.callees[0]
140
+ assert_equal('Integer#times', call_tree.target.full_name)
141
+ assert_equal(15, call_tree.line)
145
142
 
146
143
  # Method 6
147
144
  method = methods[6]
148
145
  assert_equal('Integer#times', method.full_name)
149
146
  assert_equal(0, method.line)
150
147
 
151
- assert_equal(1, method.callers.count)
152
- call_info = method.callers[0]
153
- assert_equal('LineNumbers#method_2', call_info.parent.full_name)
154
- assert_equal(15, call_info.line)
148
+ assert_equal(1, method.call_trees.callers.count)
149
+ call_tree = method.call_trees.callers[0]
150
+ assert_equal('LineNumbers#method_2', call_tree.parent.target.full_name)
151
+ assert_equal(15, call_tree.line)
155
152
 
156
- assert_equal(1, method.callees.count)
157
- call_info = method.callees[0]
158
- assert_equal('LineNumbers#method_3', call_info.target.full_name)
159
- assert_equal(17, call_info.line)
153
+ assert_equal(1, method.call_trees.callees.count)
154
+ call_tree = method.call_trees.callees[0]
155
+ assert_equal('LineNumbers#method_3', call_tree.target.full_name)
156
+ assert_equal(17, call_tree.line)
160
157
  end
161
158
  end
@@ -16,6 +16,7 @@ class MarshalTest < TestCase
16
16
  thread_2 = threads_2[i]
17
17
  assert_nil(thread_2.id)
18
18
  assert_equal(thread_1.fiber_id, thread_2.fiber_id)
19
+ verify_call_info(thread_1.call_tree, thread_2.call_tree)
19
20
 
20
21
  verify_methods(thread_1.methods, thread_2.methods)
21
22
  end
@@ -35,17 +36,12 @@ class MarshalTest < TestCase
35
36
  assert_equal(method_1.full_name, method_2.full_name)
36
37
 
37
38
  assert_equal(method_1.recursive?, method_2.recursive?)
38
- assert_equal(method_1.root?, method_2.root?)
39
- assert_equal(method_1.excluded?, method_2.excluded?)
40
39
 
41
40
  assert_equal(method_1.source_file, method_2.source_file)
42
41
  assert_equal(method_1.line, method_2.line)
43
42
 
44
43
  verify_measurement(method_1.measurement, method_2.measurement)
45
-
46
- verify_call_infos(method_1.callers, method_2.callers)
47
- verify_call_infos(method_1.callees, method_2.callees)
48
-
44
+ verify_call_infos(method_1.call_trees, method_2.call_trees)
49
45
  verify_allocations(method_1.allocations, method_2.allocations)
50
46
  end
51
47
  end
@@ -69,17 +65,17 @@ class MarshalTest < TestCase
69
65
  end
70
66
 
71
67
  def verify_call_infos(call_infos_1, call_infos_2)
72
- assert_equal(call_infos_1.count, call_infos_2.count)
73
- call_infos_1.count.times do |i|
74
- call_info_1 = call_infos_1[i]
75
- call_info_2 = call_infos_2[i]
68
+ assert_equal(call_infos_1.call_trees.count, call_infos_2.call_trees.count)
69
+ call_infos_1.call_trees.count.times do |i|
70
+ call_info_1 = call_infos_1.call_trees[i]
71
+ call_info_2 = call_infos_2.call_trees[i]
76
72
  verify_call_info(call_info_1, call_info_2)
77
73
  end
78
74
  end
79
75
 
80
76
  def verify_call_info(call_info_1, call_info_2)
81
- assert_equal(call_info_1.parent, call_info_2.parent)
82
77
  assert_equal(call_info_1.target, call_info_2.target)
78
+ assert_equal(call_info_1.parent&.target, call_info_2.parent&.target)
83
79
 
84
80
  assert_equal(call_info_1.depth, call_info_2.depth)
85
81
  assert_equal(call_info_1.source_file, call_info_2.source_file)
@@ -23,10 +23,6 @@ class MeasureAllocationsTest < TestCase
23
23
  thread = result.threads.first
24
24
  assert_in_delta(20, thread.total_time, 1)
25
25
 
26
- root_methods = thread.root_methods
27
- assert_equal(1, root_methods.count)
28
- assert_equal("MeasureAllocationsTest#test_allocations", root_methods[0].full_name)
29
-
30
26
  methods = result.threads.first.methods.sort.reverse
31
27
  assert_equal(13, methods.length)
32
28
 
@@ -38,28 +34,22 @@ class MeasureAllocationsTest < TestCase
38
34
  assert_equal(0, method.self_time)
39
35
  assert_in_delta(20, method.children_time, 1)
40
36
 
41
- assert_equal(1, method.callers.length)
42
- call_info = method.callers[0]
43
- assert_nil(call_info.parent)
44
- assert_equal(20, call_info.total_time)
45
- assert_equal(0, call_info.wait_time)
46
- assert_equal(0, call_info.self_time)
47
- assert_equal(20, call_info.children_time)
48
-
49
- assert_equal(2, method.callees.length)
50
- call_info = method.callees[0]
51
- assert_equal('Class#new', call_info.target.full_name)
52
- assert_equal(1, call_info.total_time)
53
- assert_equal(0, call_info.wait_time)
54
- assert_equal(1, call_info.self_time)
55
- assert_equal(0, call_info.children_time)
56
-
57
- call_info = method.callees[1]
58
- assert_equal('Allocator#run', call_info.target.full_name)
59
- assert_equal(19, call_info.total_time)
60
- assert_equal(0, call_info.wait_time)
61
- assert_equal(0, call_info.self_time)
62
- assert_equal(19, call_info.children_time)
37
+ assert_equal(0, method.call_trees.callers.length)
38
+
39
+ assert_equal(2, method.call_trees.callees.length)
40
+ call_tree = method.call_trees.callees[0]
41
+ assert_equal('Class#new', call_tree.target.full_name)
42
+ assert_equal(1, call_tree.total_time)
43
+ assert_equal(0, call_tree.wait_time)
44
+ assert_equal(1, call_tree.self_time)
45
+ assert_equal(0, call_tree.children_time)
46
+
47
+ call_tree = method.call_trees.callees[1]
48
+ assert_equal('Allocator#run', call_tree.target.full_name)
49
+ assert_equal(19, call_tree.total_time)
50
+ assert_equal(0, call_tree.wait_time)
51
+ assert_equal(0, call_tree.self_time)
52
+ assert_equal(19, call_tree.children_time)
63
53
 
64
54
  # Method 1
65
55
  method = methods[1]
@@ -69,21 +59,21 @@ class MeasureAllocationsTest < TestCase
69
59
  assert_equal(0, method.self_time)
70
60
  assert_equal(19, method.children_time)
71
61
 
72
- assert_equal(1, method.callers.length)
73
- call_info = method.callers[0]
74
- assert_equal('MeasureAllocationsTest#test_allocations', call_info.parent.full_name)
75
- assert_equal(19, call_info.total_time)
76
- assert_equal(0, call_info.wait_time)
77
- assert_equal(0, call_info.self_time)
78
- assert_equal(19, call_info.children_time)
79
-
80
- assert_equal(1, method.callees.length)
81
- call_info = method.callees[0]
82
- assert_equal('Allocator#internal_run', call_info.target.full_name)
83
- assert_equal(19, call_info.total_time)
84
- assert_equal(0, call_info.wait_time)
85
- assert_equal(0, call_info.self_time)
86
- assert_equal(19, call_info.children_time)
62
+ assert_equal(1, method.call_trees.callers.length)
63
+ call_tree = method.call_trees.callers[0]
64
+ assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
65
+ assert_equal(19, call_tree.total_time)
66
+ assert_equal(0, call_tree.wait_time)
67
+ assert_equal(0, call_tree.self_time)
68
+ assert_equal(19, call_tree.children_time)
69
+
70
+ assert_equal(1, method.call_trees.callees.length)
71
+ call_tree = method.call_trees.callees[0]
72
+ assert_equal('Allocator#internal_run', call_tree.target.full_name)
73
+ assert_equal(19, call_tree.total_time)
74
+ assert_equal(0, call_tree.wait_time)
75
+ assert_equal(0, call_tree.self_time)
76
+ assert_equal(19, call_tree.children_time)
87
77
 
88
78
  # Method 2
89
79
  method = methods[2]
@@ -93,35 +83,35 @@ class MeasureAllocationsTest < TestCase
93
83
  assert_equal(0, method.self_time)
94
84
  assert_equal(19, method.children_time)
95
85
 
96
- assert_equal(1, method.callers.length)
97
- call_info = method.callers[0]
98
- assert_equal('Allocator#run', call_info.parent.full_name)
99
- assert_equal(19, call_info.total_time)
100
- assert_equal(0, call_info.wait_time)
101
- assert_equal(0, call_info.self_time)
102
- assert_equal(19, call_info.children_time)
103
-
104
- assert_equal(3, method.callees.length)
105
- call_info = method.callees[0]
106
- assert_equal('Allocator#make_arrays', call_info.target.full_name)
107
- assert_equal(10, call_info.total_time)
108
- assert_equal(0, call_info.wait_time)
109
- assert_equal(0, call_info.self_time)
110
- assert_equal(10, call_info.children_time)
111
-
112
- call_info = method.callees[1]
113
- assert_equal('Allocator#make_hashes', call_info.target.full_name)
114
- assert_equal(5, call_info.total_time)
115
- assert_equal(0, call_info.wait_time)
116
- assert_equal(0, call_info.self_time)
117
- assert_equal(5, call_info.children_time)
118
-
119
- call_info = method.callees[2]
120
- assert_equal('Allocator#make_strings', call_info.target.full_name)
121
- assert_equal(4, call_info.total_time)
122
- assert_equal(0, call_info.wait_time)
123
- assert_equal(1, call_info.self_time)
124
- assert_equal(3, call_info.children_time)
86
+ assert_equal(1, method.call_trees.callers.length)
87
+ call_tree = method.call_trees.callers[0]
88
+ assert_equal('Allocator#run', call_tree.parent.target.full_name)
89
+ assert_equal(19, call_tree.total_time)
90
+ assert_equal(0, call_tree.wait_time)
91
+ assert_equal(0, call_tree.self_time)
92
+ assert_equal(19, call_tree.children_time)
93
+
94
+ assert_equal(3, method.call_trees.callees.length)
95
+ call_tree = method.call_trees.callees[0]
96
+ assert_equal('Allocator#make_arrays', call_tree.target.full_name)
97
+ assert_equal(10, call_tree.total_time)
98
+ assert_equal(0, call_tree.wait_time)
99
+ assert_equal(0, call_tree.self_time)
100
+ assert_equal(10, call_tree.children_time)
101
+
102
+ call_tree = method.call_trees.callees[1]
103
+ assert_equal('Allocator#make_hashes', call_tree.target.full_name)
104
+ assert_equal(5, call_tree.total_time)
105
+ assert_equal(0, call_tree.wait_time)
106
+ assert_equal(0, call_tree.self_time)
107
+ assert_equal(5, call_tree.children_time)
108
+
109
+ call_tree = method.call_trees.callees[2]
110
+ assert_equal('Allocator#make_strings', call_tree.target.full_name)
111
+ assert_equal(4, call_tree.total_time)
112
+ assert_equal(0, call_tree.wait_time)
113
+ assert_equal(1, call_tree.self_time)
114
+ assert_equal(3, call_tree.children_time)
125
115
 
126
116
  # Method 3
127
117
  method = methods[3]
@@ -131,63 +121,63 @@ class MeasureAllocationsTest < TestCase
131
121
  assert_equal(17, method.self_time)
132
122
  assert_equal(1, method.children_time)
133
123
 
134
- assert_equal(4, method.callers.length)
135
- call_info = method.callers[0]
136
- assert_equal('MeasureAllocationsTest#test_allocations', call_info.parent.full_name)
137
- assert_equal(1, call_info.total_time)
138
- assert_equal(0, call_info.wait_time)
139
- assert_equal(1, call_info.self_time)
140
- assert_equal(0, call_info.children_time)
141
-
142
- call_info = method.callers[1]
143
- assert_equal('Integer#times', call_info.parent.full_name)
144
- assert_equal(10, call_info.total_time)
145
- assert_equal(0, call_info.wait_time)
146
- assert_equal(10, call_info.self_time)
147
- assert_equal(0, call_info.children_time)
148
-
149
- call_info = method.callers[2]
150
- assert_equal('Allocator#make_hashes', call_info.parent.full_name)
151
- assert_equal(5, call_info.total_time)
152
- assert_equal(0, call_info.wait_time)
153
- assert_equal(5, call_info.self_time)
154
- assert_equal(0, call_info.children_time)
155
-
156
- call_info = method.callers[3]
157
- assert_equal('Allocator#make_strings', call_info.parent.full_name)
158
- assert_equal(2, call_info.total_time)
159
- assert_equal(0, call_info.wait_time)
160
- assert_equal(1, call_info.self_time)
161
- assert_equal(1, call_info.children_time)
162
-
163
- assert_equal(4, method.callees.length)
164
- call_info = method.callees[0]
165
- assert_equal('BasicObject#initialize', call_info.target.full_name)
166
- assert_equal(0, call_info.total_time)
167
- assert_equal(0, call_info.wait_time)
168
- assert_equal(0, call_info.self_time)
169
- assert_equal(0, call_info.children_time)
170
-
171
- call_info = method.callees[1]
172
- assert_equal('Array#initialize', call_info.target.full_name)
173
- assert_equal(0, call_info.total_time)
174
- assert_equal(0, call_info.wait_time)
175
- assert_equal(0, call_info.self_time)
176
- assert_equal(0, call_info.children_time)
177
-
178
- call_info = method.callees[2]
179
- assert_equal('Hash#initialize', call_info.target.full_name)
180
- assert_equal(0, call_info.total_time)
181
- assert_equal(0, call_info.wait_time)
182
- assert_equal(0, call_info.self_time)
183
- assert_equal(0, call_info.children_time)
184
-
185
- call_info = method.callees[3]
186
- assert_equal('String#initialize', call_info.target.full_name)
187
- assert_equal(1, call_info.total_time)
188
- assert_equal(0, call_info.wait_time)
189
- assert_equal(1, call_info.self_time)
190
- assert_equal(0, call_info.children_time)
124
+ assert_equal(4, method.call_trees.callers.length)
125
+ call_tree = method.call_trees.callers[0]
126
+ assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
127
+ assert_equal(1, call_tree.total_time)
128
+ assert_equal(0, call_tree.wait_time)
129
+ assert_equal(1, call_tree.self_time)
130
+ assert_equal(0, call_tree.children_time)
131
+
132
+ call_tree = method.call_trees.callers[1]
133
+ assert_equal('Integer#times', call_tree.parent.target.full_name)
134
+ assert_equal(10, call_tree.total_time)
135
+ assert_equal(0, call_tree.wait_time)
136
+ assert_equal(10, call_tree.self_time)
137
+ assert_equal(0, call_tree.children_time)
138
+
139
+ call_tree = method.call_trees.callers[2]
140
+ assert_equal('Allocator#make_hashes', call_tree.parent.target.full_name)
141
+ assert_equal(5, call_tree.total_time)
142
+ assert_equal(0, call_tree.wait_time)
143
+ assert_equal(5, call_tree.self_time)
144
+ assert_equal(0, call_tree.children_time)
145
+
146
+ call_tree = method.call_trees.callers[3]
147
+ assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
148
+ assert_equal(2, call_tree.total_time)
149
+ assert_equal(0, call_tree.wait_time)
150
+ assert_equal(1, call_tree.self_time)
151
+ assert_equal(1, call_tree.children_time)
152
+
153
+ assert_equal(4, method.call_trees.callees.length)
154
+ call_tree = method.call_trees.callees[0]
155
+ assert_equal('BasicObject#initialize', call_tree.target.full_name)
156
+ assert_equal(0, call_tree.total_time)
157
+ assert_equal(0, call_tree.wait_time)
158
+ assert_equal(0, call_tree.self_time)
159
+ assert_equal(0, call_tree.children_time)
160
+
161
+ call_tree = method.call_trees.callees[1]
162
+ assert_equal('Array#initialize', call_tree.target.full_name)
163
+ assert_equal(0, call_tree.total_time)
164
+ assert_equal(0, call_tree.wait_time)
165
+ assert_equal(0, call_tree.self_time)
166
+ assert_equal(0, call_tree.children_time)
167
+
168
+ call_tree = method.call_trees.callees[2]
169
+ assert_equal('Hash#initialize', call_tree.target.full_name)
170
+ assert_equal(0, call_tree.total_time)
171
+ assert_equal(0, call_tree.wait_time)
172
+ assert_equal(0, call_tree.self_time)
173
+ assert_equal(0, call_tree.children_time)
174
+
175
+ call_tree = method.call_trees.callees[3]
176
+ assert_equal('String#initialize', call_tree.target.full_name)
177
+ assert_equal(1, call_tree.total_time)
178
+ assert_equal(0, call_tree.wait_time)
179
+ assert_equal(1, call_tree.self_time)
180
+ assert_equal(0, call_tree.children_time)
191
181
 
192
182
  # Method 4
193
183
  method = methods[4]
@@ -197,21 +187,21 @@ class MeasureAllocationsTest < TestCase
197
187
  assert_equal(0, method.self_time)
198
188
  assert_equal(10, method.children_time)
199
189
 
200
- assert_equal(1, method.callers.length)
201
- call_info = method.callers[0]
202
- assert_equal('Allocator#internal_run', call_info.parent.full_name)
203
- assert_equal(10, call_info.total_time)
204
- assert_equal(0, call_info.wait_time)
205
- assert_equal(0, call_info.self_time)
206
- assert_equal(10, call_info.children_time)
207
-
208
- assert_equal(1, method.callees.length)
209
- call_info = method.callees[0]
210
- assert_equal('Integer#times', call_info.target.full_name)
211
- assert_equal(10, call_info.total_time)
212
- assert_equal(0, call_info.wait_time)
213
- assert_equal(0, call_info.self_time)
214
- assert_equal(10, call_info.children_time)
190
+ assert_equal(1, method.call_trees.callers.length)
191
+ call_tree = method.call_trees.callers[0]
192
+ assert_equal('Allocator#internal_run', call_tree.parent.target.full_name)
193
+ assert_equal(10, call_tree.total_time)
194
+ assert_equal(0, call_tree.wait_time)
195
+ assert_equal(0, call_tree.self_time)
196
+ assert_equal(10, call_tree.children_time)
197
+
198
+ assert_equal(1, method.call_trees.callees.length)
199
+ call_tree = method.call_trees.callees[0]
200
+ assert_equal('Integer#times', call_tree.target.full_name)
201
+ assert_equal(10, call_tree.total_time)
202
+ assert_equal(0, call_tree.wait_time)
203
+ assert_equal(0, call_tree.self_time)
204
+ assert_equal(10, call_tree.children_time)
215
205
 
216
206
  # Method 5
217
207
  method = methods[5]
@@ -221,21 +211,21 @@ class MeasureAllocationsTest < TestCase
221
211
  assert_equal(0, method.self_time)
222
212
  assert_equal(10, method.children_time)
223
213
 
224
- assert_equal(1, method.callers.length)
225
- call_info = method.callers[0]
226
- assert_equal('Allocator#make_arrays', call_info.parent.full_name)
227
- assert_equal(10, call_info.total_time)
228
- assert_equal(0, call_info.wait_time)
229
- assert_equal(0, call_info.self_time)
230
- assert_equal(10, call_info.children_time)
231
-
232
- assert_equal(1, method.callees.length)
233
- call_info = method.callees[0]
234
- assert_equal('Class#new', call_info.target.full_name)
235
- assert_equal(10, call_info.total_time)
236
- assert_equal(0, call_info.wait_time)
237
- assert_equal(10, call_info.self_time)
238
- assert_equal(0, call_info.children_time)
214
+ assert_equal(1, method.call_trees.callers.length)
215
+ call_tree = method.call_trees.callers[0]
216
+ assert_equal('Allocator#make_arrays', call_tree.parent.target.full_name)
217
+ assert_equal(10, call_tree.total_time)
218
+ assert_equal(0, call_tree.wait_time)
219
+ assert_equal(0, call_tree.self_time)
220
+ assert_equal(10, call_tree.children_time)
221
+
222
+ assert_equal(1, method.call_trees.callees.length)
223
+ call_tree = method.call_trees.callees[0]
224
+ assert_equal('Class#new', call_tree.target.full_name)
225
+ assert_equal(10, call_tree.total_time)
226
+ assert_equal(0, call_tree.wait_time)
227
+ assert_equal(10, call_tree.self_time)
228
+ assert_equal(0, call_tree.children_time)
239
229
 
240
230
  # Method 6
241
231
  method = methods[6]
@@ -245,21 +235,21 @@ class MeasureAllocationsTest < TestCase
245
235
  assert_equal(0, method.self_time)
246
236
  assert_equal(5, method.children_time)
247
237
 
248
- assert_equal(1, method.callers.length)
249
- call_info = method.callers[0]
250
- assert_equal('Allocator#internal_run', call_info.parent.full_name)
251
- assert_equal(5, call_info.total_time)
252
- assert_equal(0, call_info.wait_time)
253
- assert_equal(0, call_info.self_time)
254
- assert_equal(5, call_info.children_time)
255
-
256
- assert_equal(1, method.callees.length)
257
- call_info = method.callees[0]
258
- assert_equal('Class#new', call_info.target.full_name)
259
- assert_equal(5, call_info.total_time)
260
- assert_equal(0, call_info.wait_time)
261
- assert_equal(5, call_info.self_time)
262
- assert_equal(0, call_info.children_time)
238
+ assert_equal(1, method.call_trees.callers.length)
239
+ call_tree = method.call_trees.callers[0]
240
+ assert_equal('Allocator#internal_run', call_tree.parent.target.full_name)
241
+ assert_equal(5, call_tree.total_time)
242
+ assert_equal(0, call_tree.wait_time)
243
+ assert_equal(0, call_tree.self_time)
244
+ assert_equal(5, call_tree.children_time)
245
+
246
+ assert_equal(1, method.call_trees.callees.length)
247
+ call_tree = method.call_trees.callees[0]
248
+ assert_equal('Class#new', call_tree.target.full_name)
249
+ assert_equal(5, call_tree.total_time)
250
+ assert_equal(0, call_tree.wait_time)
251
+ assert_equal(5, call_tree.self_time)
252
+ assert_equal(0, call_tree.children_time)
263
253
 
264
254
  # Method 7
265
255
  method = methods[7]
@@ -269,28 +259,28 @@ class MeasureAllocationsTest < TestCase
269
259
  assert_equal(1, method.self_time)
270
260
  assert_equal(3, method.children_time)
271
261
 
272
- assert_equal(1, method.callers.length)
273
- call_info = method.callers[0]
274
- assert_equal('Allocator#internal_run', call_info.parent.full_name)
275
- assert_equal(4, call_info.total_time)
276
- assert_equal(0, call_info.wait_time)
277
- assert_equal(1, call_info.self_time)
278
- assert_equal(3, call_info.children_time)
279
-
280
- assert_equal(2, method.callees.length)
281
- call_info = method.callees[0]
282
- assert_equal('String#*', call_info.target.full_name)
283
- assert_equal(1, call_info.total_time)
284
- assert_equal(0, call_info.wait_time)
285
- assert_equal(1, call_info.self_time)
286
- assert_equal(0, call_info.children_time)
287
-
288
- call_info = method.callees[1]
289
- assert_equal('Class#new', call_info.target.full_name)
290
- assert_equal(2, call_info.total_time)
291
- assert_equal(0, call_info.wait_time)
292
- assert_equal(1, call_info.self_time)
293
- assert_equal(1, call_info.children_time)
262
+ assert_equal(1, method.call_trees.callers.length)
263
+ call_tree = method.call_trees.callers[0]
264
+ assert_equal('Allocator#internal_run', call_tree.parent.target.full_name)
265
+ assert_equal(4, call_tree.total_time)
266
+ assert_equal(0, call_tree.wait_time)
267
+ assert_equal(1, call_tree.self_time)
268
+ assert_equal(3, call_tree.children_time)
269
+
270
+ assert_equal(2, method.call_trees.callees.length)
271
+ call_tree = method.call_trees.callees[0]
272
+ assert_equal('String#*', call_tree.target.full_name)
273
+ assert_equal(1, call_tree.total_time)
274
+ assert_equal(0, call_tree.wait_time)
275
+ assert_equal(1, call_tree.self_time)
276
+ assert_equal(0, call_tree.children_time)
277
+
278
+ call_tree = method.call_trees.callees[1]
279
+ assert_equal('Class#new', call_tree.target.full_name)
280
+ assert_equal(2, call_tree.total_time)
281
+ assert_equal(0, call_tree.wait_time)
282
+ assert_equal(1, call_tree.self_time)
283
+ assert_equal(1, call_tree.children_time)
294
284
 
295
285
  # Method 8
296
286
  method = methods[8]
@@ -300,15 +290,15 @@ class MeasureAllocationsTest < TestCase
300
290
  assert_equal(1, method.self_time)
301
291
  assert_equal(0, method.children_time)
302
292
 
303
- assert_equal(1, method.callers.length)
304
- call_info = method.callers[0]
305
- assert_equal('Allocator#make_strings', call_info.parent.full_name)
306
- assert_equal(1, call_info.total_time)
307
- assert_equal(0, call_info.wait_time)
308
- assert_equal(1, call_info.self_time)
309
- assert_equal(0, call_info.children_time)
293
+ assert_equal(1, method.call_trees.callers.length)
294
+ call_tree = method.call_trees.callers[0]
295
+ assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
296
+ assert_equal(1, call_tree.total_time)
297
+ assert_equal(0, call_tree.wait_time)
298
+ assert_equal(1, call_tree.self_time)
299
+ assert_equal(0, call_tree.children_time)
310
300
 
311
- assert_equal(0, method.callees.length)
301
+ assert_equal(0, method.call_trees.callees.length)
312
302
 
313
303
  # Method 9
314
304
  method = methods[9]
@@ -318,15 +308,15 @@ class MeasureAllocationsTest < TestCase
318
308
  assert_equal(1, method.self_time)
319
309
  assert_equal(0, method.children_time)
320
310
 
321
- assert_equal(1, method.callers.length)
322
- call_info = method.callers[0]
323
- assert_equal('Class#new', call_info.parent.full_name)
324
- assert_equal(1, call_info.total_time)
325
- assert_equal(0, call_info.wait_time)
326
- assert_equal(1, call_info.self_time)
327
- assert_equal(0, call_info.children_time)
311
+ assert_equal(1, method.call_trees.callers.length)
312
+ call_tree = method.call_trees.callers[0]
313
+ assert_equal('Class#new', call_tree.parent.target.full_name)
314
+ assert_equal(1, call_tree.total_time)
315
+ assert_equal(0, call_tree.wait_time)
316
+ assert_equal(1, call_tree.self_time)
317
+ assert_equal(0, call_tree.children_time)
328
318
 
329
- assert_equal(0, method.callees.length)
319
+ assert_equal(0, method.call_trees.callees.length)
330
320
 
331
321
  # Method 10
332
322
  method = methods[10]
@@ -336,15 +326,15 @@ class MeasureAllocationsTest < TestCase
336
326
  assert_equal(0, method.self_time)
337
327
  assert_equal(0, method.children_time)
338
328
 
339
- assert_equal(1, method.callers.length)
340
- call_info = method.callers[0]
341
- assert_equal('Class#new', call_info.parent.full_name)
342
- assert_equal(0, call_info.total_time)
343
- assert_equal(0, call_info.wait_time)
344
- assert_equal(0, call_info.self_time)
345
- assert_equal(0, call_info.children_time)
329
+ assert_equal(1, method.call_trees.callers.length)
330
+ call_tree = method.call_trees.callers[0]
331
+ assert_equal('Class#new', call_tree.parent.target.full_name)
332
+ assert_equal(0, call_tree.total_time)
333
+ assert_equal(0, call_tree.wait_time)
334
+ assert_equal(0, call_tree.self_time)
335
+ assert_equal(0, call_tree.children_time)
346
336
 
347
- assert_equal(0, method.callees.length)
337
+ assert_equal(0, method.call_trees.callees.length)
348
338
 
349
339
  # Method 11
350
340
  method = methods[11]
@@ -354,15 +344,15 @@ class MeasureAllocationsTest < TestCase
354
344
  assert_equal(0, method.self_time)
355
345
  assert_equal(0, method.children_time)
356
346
 
357
- assert_equal(1, method.callers.length)
358
- call_info = method.callers[0]
359
- assert_equal('Class#new', call_info.parent.full_name)
360
- assert_equal(0, call_info.total_time)
361
- assert_equal(0, call_info.wait_time)
362
- assert_equal(0, call_info.self_time)
363
- assert_equal(0, call_info.children_time)
347
+ assert_equal(1, method.call_trees.callers.length)
348
+ call_tree = method.call_trees.callers[0]
349
+ assert_equal('Class#new', call_tree.parent.target.full_name)
350
+ assert_equal(0, call_tree.total_time)
351
+ assert_equal(0, call_tree.wait_time)
352
+ assert_equal(0, call_tree.self_time)
353
+ assert_equal(0, call_tree.children_time)
364
354
 
365
- assert_equal(0, method.callees.length)
355
+ assert_equal(0, method.call_trees.callees.length)
366
356
 
367
357
  # Method 12
368
358
  method = methods[12]
@@ -372,14 +362,14 @@ class MeasureAllocationsTest < TestCase
372
362
  assert_equal(0, method.self_time)
373
363
  assert_equal(0, method.children_time)
374
364
 
375
- assert_equal(1, method.callers.length)
376
- call_info = method.callers[0]
377
- assert_equal('Class#new', call_info.parent.full_name)
378
- assert_equal(0, call_info.total_time)
379
- assert_equal(0, call_info.wait_time)
380
- assert_equal(0, call_info.self_time)
381
- assert_equal(0, call_info.children_time)
365
+ assert_equal(1, method.call_trees.callers.length)
366
+ call_tree = method.call_trees.callers[0]
367
+ assert_equal('Class#new', call_tree.parent.target.full_name)
368
+ assert_equal(0, call_tree.total_time)
369
+ assert_equal(0, call_tree.wait_time)
370
+ assert_equal(0, call_tree.self_time)
371
+ assert_equal(0, call_tree.children_time)
382
372
 
383
- assert_equal(0, method.callees.length)
373
+ assert_equal(0, method.call_trees.callees.length)
384
374
  end
385
375
  end