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.
- checksums.yaml +4 -4
- data/CHANGES +19 -1
- data/bin/ruby-prof +100 -152
- data/ext/ruby_prof/rp_aggregate_call_tree.c +59 -0
- data/ext/ruby_prof/rp_aggregate_call_tree.h +13 -0
- data/ext/ruby_prof/rp_allocation.c +67 -59
- data/ext/ruby_prof/rp_allocation.h +3 -3
- data/ext/ruby_prof/rp_call_tree.c +369 -0
- data/ext/ruby_prof/rp_call_tree.h +43 -0
- data/ext/ruby_prof/rp_call_trees.c +288 -0
- data/ext/ruby_prof/rp_call_trees.h +28 -0
- data/ext/ruby_prof/rp_measure_allocations.c +11 -13
- data/ext/ruby_prof/rp_measure_process_time.c +11 -13
- data/ext/ruby_prof/rp_measure_wall_time.c +17 -15
- data/ext/ruby_prof/rp_measurement.c +47 -40
- data/ext/ruby_prof/rp_measurement.h +7 -7
- data/ext/ruby_prof/rp_method.c +116 -255
- data/ext/ruby_prof/rp_method.h +31 -39
- data/ext/ruby_prof/rp_profile.c +311 -281
- data/ext/ruby_prof/rp_profile.h +1 -2
- data/ext/ruby_prof/rp_stack.c +113 -105
- data/ext/ruby_prof/rp_stack.h +17 -20
- data/ext/ruby_prof/rp_thread.c +136 -111
- data/ext/ruby_prof/rp_thread.h +12 -9
- data/ext/ruby_prof/ruby_prof.c +27 -23
- data/ext/ruby_prof/ruby_prof.h +9 -0
- data/ext/ruby_prof/vc/ruby_prof.vcxproj +11 -7
- data/lib/ruby-prof.rb +2 -3
- data/lib/ruby-prof/assets/call_stack_printer.html.erb +4 -7
- data/lib/ruby-prof/assets/graph_printer.html.erb +5 -6
- data/lib/ruby-prof/{call_info.rb → call_tree.rb} +6 -6
- data/lib/ruby-prof/call_tree_visitor.rb +36 -0
- data/lib/ruby-prof/measurement.rb +5 -2
- data/lib/ruby-prof/method_info.rb +3 -15
- data/lib/ruby-prof/printers/call_info_printer.rb +12 -10
- data/lib/ruby-prof/printers/call_stack_printer.rb +19 -22
- data/lib/ruby-prof/printers/call_tree_printer.rb +1 -1
- data/lib/ruby-prof/printers/dot_printer.rb +3 -3
- data/lib/ruby-prof/printers/graph_printer.rb +3 -4
- data/lib/ruby-prof/printers/multi_printer.rb +2 -2
- data/lib/ruby-prof/rack.rb +3 -0
- data/lib/ruby-prof/thread.rb +3 -18
- data/lib/ruby-prof/version.rb +1 -1
- data/ruby-prof.gemspec +7 -0
- data/test/alias_test.rb +42 -45
- data/test/basic_test.rb +0 -86
- data/test/{call_info_visitor_test.rb → call_tree_visitor_test.rb} +6 -5
- data/test/call_trees_test.rb +66 -0
- data/test/exclude_methods_test.rb +17 -12
- data/test/fiber_test.rb +197 -9
- data/test/gc_test.rb +36 -42
- data/test/inverse_call_tree_test.rb +175 -0
- data/test/line_number_test.rb +67 -70
- data/test/marshal_test.rb +7 -11
- data/test/measure_allocations_test.rb +224 -234
- data/test/measure_allocations_trace_test.rb +224 -234
- data/test/measure_memory_trace_test.rb +814 -469
- data/test/measure_process_time_test.rb +0 -64
- data/test/measure_times.rb +2 -0
- data/test/measure_wall_time_test.rb +34 -58
- data/test/pause_resume_test.rb +19 -10
- data/test/prime.rb +1 -3
- data/test/prime_script.rb +6 -0
- data/test/printers_test.rb +1 -1
- data/test/recursive_test.rb +50 -54
- data/test/start_stop_test.rb +19 -19
- data/test/test_helper.rb +3 -15
- data/test/thread_test.rb +11 -11
- data/test/unique_call_path_test.rb +25 -95
- metadata +19 -10
- data/ext/ruby_prof/rp_call_info.c +0 -271
- data/ext/ruby_prof/rp_call_info.h +0 -35
- data/lib/2.6.5/ruby_prof.so +0 -0
- data/lib/ruby-prof/call_info_visitor.rb +0 -38
- data/test/parser_timings.rb +0 -24
@@ -23,10 +23,6 @@ class MeasureAllocationsTraceTest < 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("MeasureAllocationsTraceTest#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 MeasureAllocationsTraceTest < TestCase
|
|
38
34
|
assert_equal(0, method.self_time)
|
39
35
|
assert_in_delta(20, method.children_time, 1)
|
40
36
|
|
41
|
-
assert_equal(
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
assert_equal(
|
46
|
-
assert_equal(
|
47
|
-
assert_equal(
|
48
|
-
|
49
|
-
assert_equal(
|
50
|
-
|
51
|
-
|
52
|
-
assert_equal(
|
53
|
-
assert_equal(
|
54
|
-
assert_equal(
|
55
|
-
assert_equal(0,
|
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 MeasureAllocationsTraceTest < 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
|
-
|
74
|
-
assert_equal('MeasureAllocationsTraceTest#test_allocations',
|
75
|
-
assert_equal(19,
|
76
|
-
assert_equal(0,
|
77
|
-
assert_equal(0,
|
78
|
-
assert_equal(19,
|
79
|
-
|
80
|
-
assert_equal(1, method.callees.length)
|
81
|
-
|
82
|
-
assert_equal('Allocator#internal_run',
|
83
|
-
assert_equal(19,
|
84
|
-
assert_equal(0,
|
85
|
-
assert_equal(0,
|
86
|
-
assert_equal(19,
|
62
|
+
assert_equal(1, method.call_trees.callers.length)
|
63
|
+
call_tree = method.call_trees.callers[0]
|
64
|
+
assert_equal('MeasureAllocationsTraceTest#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 MeasureAllocationsTraceTest < 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
|
-
|
98
|
-
assert_equal('Allocator#run',
|
99
|
-
assert_equal(19,
|
100
|
-
assert_equal(0,
|
101
|
-
assert_equal(0,
|
102
|
-
assert_equal(19,
|
103
|
-
|
104
|
-
assert_equal(3, method.callees.length)
|
105
|
-
|
106
|
-
assert_equal('Allocator#make_arrays',
|
107
|
-
assert_equal(10,
|
108
|
-
assert_equal(0,
|
109
|
-
assert_equal(0,
|
110
|
-
assert_equal(10,
|
111
|
-
|
112
|
-
|
113
|
-
assert_equal('Allocator#make_hashes',
|
114
|
-
assert_equal(5,
|
115
|
-
assert_equal(0,
|
116
|
-
assert_equal(0,
|
117
|
-
assert_equal(5,
|
118
|
-
|
119
|
-
|
120
|
-
assert_equal('Allocator#make_strings',
|
121
|
-
assert_equal(4,
|
122
|
-
assert_equal(0,
|
123
|
-
assert_equal(1,
|
124
|
-
assert_equal(3,
|
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 MeasureAllocationsTraceTest < 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
|
-
|
136
|
-
assert_equal('MeasureAllocationsTraceTest#test_allocations',
|
137
|
-
assert_equal(1,
|
138
|
-
assert_equal(0,
|
139
|
-
assert_equal(1,
|
140
|
-
assert_equal(0,
|
141
|
-
|
142
|
-
|
143
|
-
assert_equal('Integer#times',
|
144
|
-
assert_equal(10,
|
145
|
-
assert_equal(0,
|
146
|
-
assert_equal(10,
|
147
|
-
assert_equal(0,
|
148
|
-
|
149
|
-
|
150
|
-
assert_equal('Allocator#make_hashes',
|
151
|
-
assert_equal(5,
|
152
|
-
assert_equal(0,
|
153
|
-
assert_equal(5,
|
154
|
-
assert_equal(0,
|
155
|
-
|
156
|
-
|
157
|
-
assert_equal('Allocator#make_strings',
|
158
|
-
assert_equal(2,
|
159
|
-
assert_equal(0,
|
160
|
-
assert_equal(1,
|
161
|
-
assert_equal(1,
|
162
|
-
|
163
|
-
assert_equal(4, method.callees.length)
|
164
|
-
|
165
|
-
assert_equal('BasicObject#initialize',
|
166
|
-
assert_equal(0,
|
167
|
-
assert_equal(0,
|
168
|
-
assert_equal(0,
|
169
|
-
assert_equal(0,
|
170
|
-
|
171
|
-
|
172
|
-
assert_equal('Array#initialize',
|
173
|
-
assert_equal(0,
|
174
|
-
assert_equal(0,
|
175
|
-
assert_equal(0,
|
176
|
-
assert_equal(0,
|
177
|
-
|
178
|
-
|
179
|
-
assert_equal('Hash#initialize',
|
180
|
-
assert_equal(0,
|
181
|
-
assert_equal(0,
|
182
|
-
assert_equal(0,
|
183
|
-
assert_equal(0,
|
184
|
-
|
185
|
-
|
186
|
-
assert_equal('String#initialize',
|
187
|
-
assert_equal(1,
|
188
|
-
assert_equal(0,
|
189
|
-
assert_equal(1,
|
190
|
-
assert_equal(0,
|
124
|
+
assert_equal(4, method.call_trees.callers.length)
|
125
|
+
call_tree = method.call_trees.callers[0]
|
126
|
+
assert_equal('MeasureAllocationsTraceTest#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 MeasureAllocationsTraceTest < 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
|
-
|
202
|
-
assert_equal('Allocator#internal_run',
|
203
|
-
assert_equal(10,
|
204
|
-
assert_equal(0,
|
205
|
-
assert_equal(0,
|
206
|
-
assert_equal(10,
|
207
|
-
|
208
|
-
assert_equal(1, method.callees.length)
|
209
|
-
|
210
|
-
assert_equal('Integer#times',
|
211
|
-
assert_equal(10,
|
212
|
-
assert_equal(0,
|
213
|
-
assert_equal(0,
|
214
|
-
assert_equal(10,
|
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 MeasureAllocationsTraceTest < 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
|
-
|
226
|
-
assert_equal('Allocator#make_arrays',
|
227
|
-
assert_equal(10,
|
228
|
-
assert_equal(0,
|
229
|
-
assert_equal(0,
|
230
|
-
assert_equal(10,
|
231
|
-
|
232
|
-
assert_equal(1, method.callees.length)
|
233
|
-
|
234
|
-
assert_equal('Class#new',
|
235
|
-
assert_equal(10,
|
236
|
-
assert_equal(0,
|
237
|
-
assert_equal(10,
|
238
|
-
assert_equal(0,
|
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 MeasureAllocationsTraceTest < 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
|
-
|
250
|
-
assert_equal('Allocator#internal_run',
|
251
|
-
assert_equal(5,
|
252
|
-
assert_equal(0,
|
253
|
-
assert_equal(0,
|
254
|
-
assert_equal(5,
|
255
|
-
|
256
|
-
assert_equal(1, method.callees.length)
|
257
|
-
|
258
|
-
assert_equal('Class#new',
|
259
|
-
assert_equal(5,
|
260
|
-
assert_equal(0,
|
261
|
-
assert_equal(5,
|
262
|
-
assert_equal(0,
|
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 MeasureAllocationsTraceTest < 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
|
-
|
274
|
-
assert_equal('Allocator#internal_run',
|
275
|
-
assert_equal(4,
|
276
|
-
assert_equal(0,
|
277
|
-
assert_equal(1,
|
278
|
-
assert_equal(3,
|
279
|
-
|
280
|
-
assert_equal(2, method.callees.length)
|
281
|
-
|
282
|
-
assert_equal('String#*',
|
283
|
-
assert_equal(1,
|
284
|
-
assert_equal(0,
|
285
|
-
assert_equal(1,
|
286
|
-
assert_equal(0,
|
287
|
-
|
288
|
-
|
289
|
-
assert_equal('Class#new',
|
290
|
-
assert_equal(2,
|
291
|
-
assert_equal(0,
|
292
|
-
assert_equal(1,
|
293
|
-
assert_equal(1,
|
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 MeasureAllocationsTraceTest < 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
|
-
|
305
|
-
assert_equal('Allocator#make_strings',
|
306
|
-
assert_equal(1,
|
307
|
-
assert_equal(0,
|
308
|
-
assert_equal(1,
|
309
|
-
assert_equal(0,
|
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 MeasureAllocationsTraceTest < 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
|
-
|
323
|
-
assert_equal('Class#new',
|
324
|
-
assert_equal(1,
|
325
|
-
assert_equal(0,
|
326
|
-
assert_equal(1,
|
327
|
-
assert_equal(0,
|
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 MeasureAllocationsTraceTest < 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
|
-
|
341
|
-
assert_equal('Class#new',
|
342
|
-
assert_equal(0,
|
343
|
-
assert_equal(0,
|
344
|
-
assert_equal(0,
|
345
|
-
assert_equal(0,
|
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 MeasureAllocationsTraceTest < 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
|
-
|
359
|
-
assert_equal('Class#new',
|
360
|
-
assert_equal(0,
|
361
|
-
assert_equal(0,
|
362
|
-
assert_equal(0,
|
363
|
-
assert_equal(0,
|
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 MeasureAllocationsTraceTest < 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
|
-
|
377
|
-
assert_equal('Class#new',
|
378
|
-
assert_equal(0,
|
379
|
-
assert_equal(0,
|
380
|
-
assert_equal(0,
|
381
|
-
assert_equal(0,
|
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
|