ruby-prof 1.4.3 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -5,17 +5,8 @@ require File.expand_path('../test_helper', __FILE__)
|
|
5
5
|
require_relative './measure_allocations'
|
6
6
|
|
7
7
|
class MeasureAllocationsTest < TestCase
|
8
|
-
def setup
|
9
|
-
RubyProf::measure_mode = RubyProf::ALLOCATIONS
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_allocations_mode
|
13
|
-
RubyProf::measure_mode = RubyProf::ALLOCATIONS
|
14
|
-
assert_equal(RubyProf::ALLOCATIONS, RubyProf::measure_mode)
|
15
|
-
end
|
16
|
-
|
17
8
|
def test_allocations
|
18
|
-
result = RubyProf.profile do
|
9
|
+
result = RubyProf::Profile.profile(measure_mode: RubyProf::ALLOCATIONS, track_allocations: true) do
|
19
10
|
allocator = Allocator.new
|
20
11
|
allocator.run
|
21
12
|
end
|
@@ -24,352 +15,646 @@ class MeasureAllocationsTest < TestCase
|
|
24
15
|
assert_in_delta(20, thread.total_time, 1)
|
25
16
|
|
26
17
|
methods = result.threads.first.methods.sort.reverse
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
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
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
18
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.2')
|
19
|
+
assert_equal(12, methods.length)
|
20
|
+
|
21
|
+
# Method 0
|
22
|
+
method = methods[0]
|
23
|
+
assert_equal('MeasureAllocationsTest#test_allocations', method.full_name)
|
24
|
+
assert_in_delta(20, method.total_time, 1)
|
25
|
+
assert_equal(0, method.wait_time)
|
26
|
+
assert_equal(0, method.self_time)
|
27
|
+
assert_in_delta(20, method.children_time, 1)
|
28
|
+
|
29
|
+
assert_equal(0, method.call_trees.callers.length)
|
30
|
+
|
31
|
+
assert_equal(2, method.call_trees.callees.length)
|
32
|
+
call_tree = method.call_trees.callees[0]
|
33
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
34
|
+
assert_equal(1, call_tree.total_time)
|
35
|
+
assert_equal(0, call_tree.wait_time)
|
36
|
+
assert_equal(1, call_tree.self_time)
|
37
|
+
assert_equal(0, call_tree.children_time)
|
38
|
+
|
39
|
+
call_tree = method.call_trees.callees[1]
|
40
|
+
assert_equal('Allocator#run', call_tree.target.full_name)
|
41
|
+
assert_equal(19, call_tree.total_time)
|
42
|
+
assert_equal(0, call_tree.wait_time)
|
43
|
+
assert_equal(0, call_tree.self_time)
|
44
|
+
assert_equal(19, call_tree.children_time)
|
45
|
+
|
46
|
+
# Method 1
|
47
|
+
method = methods[1]
|
48
|
+
assert_equal('Allocator#run',method.full_name)
|
49
|
+
assert_equal(19, method.total_time)
|
50
|
+
assert_equal(0, method.wait_time)
|
51
|
+
assert_equal(0, method.self_time)
|
52
|
+
assert_equal(19, method.children_time)
|
53
|
+
|
54
|
+
assert_equal(1, method.call_trees.callers.length)
|
55
|
+
call_tree = method.call_trees.callers[0]
|
56
|
+
assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
|
57
|
+
assert_equal(19, call_tree.total_time)
|
58
|
+
assert_equal(0, call_tree.wait_time)
|
59
|
+
assert_equal(0, call_tree.self_time)
|
60
|
+
assert_equal(19, call_tree.children_time)
|
61
|
+
|
62
|
+
assert_equal(3, method.call_trees.callees.length)
|
63
|
+
call_tree = method.call_trees.callees[0]
|
64
|
+
assert_equal('Allocator#make_arrays', call_tree.target.full_name)
|
65
|
+
assert_equal(10, call_tree.total_time)
|
66
|
+
assert_equal(0, call_tree.wait_time)
|
67
|
+
assert_equal(0, call_tree.self_time)
|
68
|
+
assert_equal(10, call_tree.children_time)
|
69
|
+
|
70
|
+
call_tree = method.call_trees.callees[1]
|
71
|
+
assert_equal('Allocator#make_hashes', call_tree.target.full_name)
|
72
|
+
assert_equal(5, call_tree.total_time)
|
73
|
+
assert_equal(0, call_tree.wait_time)
|
74
|
+
assert_equal(0, call_tree.self_time)
|
75
|
+
assert_equal(5, call_tree.children_time)
|
76
|
+
|
77
|
+
call_tree = method.call_trees.callees[2]
|
78
|
+
assert_equal('Allocator#make_strings', call_tree.target.full_name)
|
79
|
+
assert_equal(4, call_tree.total_time)
|
80
|
+
assert_equal(0, call_tree.wait_time)
|
81
|
+
assert_equal(1, call_tree.self_time)
|
82
|
+
assert_equal(3, call_tree.children_time)
|
83
|
+
|
84
|
+
# Method 2
|
85
|
+
method = methods[2]
|
86
|
+
assert_equal('Class#new', method.full_name)
|
87
|
+
assert_equal(18, method.total_time)
|
88
|
+
assert_equal(0, method.wait_time)
|
89
|
+
assert_equal(17, method.self_time)
|
90
|
+
assert_equal(1, method.children_time)
|
91
|
+
|
92
|
+
assert_equal(4, method.call_trees.callers.length)
|
93
|
+
call_tree = method.call_trees.callers[0]
|
94
|
+
assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
|
95
|
+
assert_equal(1, call_tree.total_time)
|
96
|
+
assert_equal(0, call_tree.wait_time)
|
97
|
+
assert_equal(1, call_tree.self_time)
|
98
|
+
assert_equal(0, call_tree.children_time)
|
99
|
+
|
100
|
+
call_tree = method.call_trees.callers[1]
|
101
|
+
assert_equal('Integer#times', call_tree.parent.target.full_name)
|
102
|
+
assert_equal(10, call_tree.total_time)
|
103
|
+
assert_equal(0, call_tree.wait_time)
|
104
|
+
assert_equal(10, call_tree.self_time)
|
105
|
+
assert_equal(0, call_tree.children_time)
|
106
|
+
|
107
|
+
call_tree = method.call_trees.callers[2]
|
108
|
+
assert_equal('Allocator#make_hashes', call_tree.parent.target.full_name)
|
109
|
+
assert_equal(5, call_tree.total_time)
|
110
|
+
assert_equal(0, call_tree.wait_time)
|
111
|
+
assert_equal(5, call_tree.self_time)
|
112
|
+
assert_equal(0, call_tree.children_time)
|
113
|
+
|
114
|
+
call_tree = method.call_trees.callers[3]
|
115
|
+
assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
|
116
|
+
assert_equal(2, call_tree.total_time)
|
117
|
+
assert_equal(0, call_tree.wait_time)
|
118
|
+
assert_equal(1, call_tree.self_time)
|
119
|
+
assert_equal(1, call_tree.children_time)
|
120
|
+
|
121
|
+
assert_equal(4, method.call_trees.callees.length)
|
122
|
+
call_tree = method.call_trees.callees[0]
|
123
|
+
assert_equal('BasicObject#initialize', call_tree.target.full_name)
|
124
|
+
assert_equal(0, call_tree.total_time)
|
125
|
+
assert_equal(0, call_tree.wait_time)
|
126
|
+
assert_equal(0, call_tree.self_time)
|
127
|
+
assert_equal(0, call_tree.children_time)
|
128
|
+
|
129
|
+
call_tree = method.call_trees.callees[1]
|
130
|
+
assert_equal('Array#initialize', call_tree.target.full_name)
|
131
|
+
assert_equal(0, call_tree.total_time)
|
132
|
+
assert_equal(0, call_tree.wait_time)
|
133
|
+
assert_equal(0, call_tree.self_time)
|
134
|
+
assert_equal(0, call_tree.children_time)
|
135
|
+
|
136
|
+
call_tree = method.call_trees.callees[2]
|
137
|
+
assert_equal('Hash#initialize', call_tree.target.full_name)
|
138
|
+
assert_equal(0, call_tree.total_time)
|
139
|
+
assert_equal(0, call_tree.wait_time)
|
140
|
+
assert_equal(0, call_tree.self_time)
|
141
|
+
assert_equal(0, call_tree.children_time)
|
142
|
+
|
143
|
+
call_tree = method.call_trees.callees[3]
|
144
|
+
assert_equal('String#initialize', call_tree.target.full_name)
|
145
|
+
assert_equal(1, call_tree.total_time)
|
146
|
+
assert_equal(0, call_tree.wait_time)
|
147
|
+
assert_equal(1, call_tree.self_time)
|
148
|
+
assert_equal(0, call_tree.children_time)
|
149
|
+
|
150
|
+
# Method 3
|
151
|
+
method = methods[3]
|
152
|
+
assert_equal('Allocator#make_arrays', method.full_name)
|
153
|
+
assert_equal(10, method.total_time)
|
154
|
+
assert_equal(0, method.wait_time)
|
155
|
+
assert_equal(0, method.self_time)
|
156
|
+
assert_equal(10, method.children_time)
|
157
|
+
|
158
|
+
assert_equal(1, method.call_trees.callers.length)
|
159
|
+
call_tree = method.call_trees.callers[0]
|
160
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
161
|
+
assert_equal(10, call_tree.total_time)
|
162
|
+
assert_equal(0, call_tree.wait_time)
|
163
|
+
assert_equal(0, call_tree.self_time)
|
164
|
+
assert_equal(10, call_tree.children_time)
|
165
|
+
|
166
|
+
assert_equal(1, method.call_trees.callees.length)
|
167
|
+
call_tree = method.call_trees.callees[0]
|
168
|
+
assert_equal('Integer#times', call_tree.target.full_name)
|
169
|
+
assert_equal(10, call_tree.total_time)
|
170
|
+
assert_equal(0, call_tree.wait_time)
|
171
|
+
assert_equal(0, call_tree.self_time)
|
172
|
+
assert_equal(10, call_tree.children_time)
|
173
|
+
|
174
|
+
# Method 4
|
175
|
+
method = methods[4]
|
176
|
+
assert_equal('Integer#times', method.full_name)
|
177
|
+
assert_equal(10, method.total_time)
|
178
|
+
assert_equal(0, method.wait_time)
|
179
|
+
assert_equal(0, method.self_time)
|
180
|
+
assert_equal(10, method.children_time)
|
181
|
+
|
182
|
+
assert_equal(1, method.call_trees.callers.length)
|
183
|
+
call_tree = method.call_trees.callers[0]
|
184
|
+
assert_equal('Allocator#make_arrays', call_tree.parent.target.full_name)
|
185
|
+
assert_equal(10, call_tree.total_time)
|
186
|
+
assert_equal(0, call_tree.wait_time)
|
187
|
+
assert_equal(0, call_tree.self_time)
|
188
|
+
assert_equal(10, call_tree.children_time)
|
189
|
+
|
190
|
+
assert_equal(1, method.call_trees.callees.length)
|
191
|
+
call_tree = method.call_trees.callees[0]
|
192
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
193
|
+
assert_equal(10, call_tree.total_time)
|
194
|
+
assert_equal(0, call_tree.wait_time)
|
195
|
+
assert_equal(10, call_tree.self_time)
|
196
|
+
assert_equal(0, call_tree.children_time)
|
197
|
+
|
198
|
+
# Method 5
|
199
|
+
method = methods[5]
|
200
|
+
assert_equal('Allocator#make_hashes', method.full_name)
|
201
|
+
assert_equal(5, method.total_time)
|
202
|
+
assert_equal(0, method.wait_time)
|
203
|
+
assert_equal(0, method.self_time)
|
204
|
+
assert_equal(5, method.children_time)
|
205
|
+
|
206
|
+
assert_equal(1, method.call_trees.callers.length)
|
207
|
+
call_tree = method.call_trees.callers[0]
|
208
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
209
|
+
assert_equal(5, call_tree.total_time)
|
210
|
+
assert_equal(0, call_tree.wait_time)
|
211
|
+
assert_equal(0, call_tree.self_time)
|
212
|
+
assert_equal(5, call_tree.children_time)
|
213
|
+
|
214
|
+
assert_equal(1, method.call_trees.callees.length)
|
215
|
+
call_tree = method.call_trees.callees[0]
|
216
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
217
|
+
assert_equal(5, call_tree.total_time)
|
218
|
+
assert_equal(0, call_tree.wait_time)
|
219
|
+
assert_equal(5, call_tree.self_time)
|
220
|
+
assert_equal(0, call_tree.children_time)
|
221
|
+
|
222
|
+
# Method 6
|
223
|
+
method = methods[6]
|
224
|
+
assert_equal('Allocator#make_strings', method.full_name)
|
225
|
+
assert_equal(4, method.total_time)
|
226
|
+
assert_equal(0, method.wait_time)
|
227
|
+
assert_equal(1, method.self_time)
|
228
|
+
assert_equal(3, method.children_time)
|
229
|
+
|
230
|
+
assert_equal(1, method.call_trees.callers.length)
|
231
|
+
call_tree = method.call_trees.callers[0]
|
232
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
233
|
+
assert_equal(4, call_tree.total_time)
|
234
|
+
assert_equal(0, call_tree.wait_time)
|
235
|
+
assert_equal(1, call_tree.self_time)
|
236
|
+
assert_equal(3, call_tree.children_time)
|
237
|
+
|
238
|
+
assert_equal(2, method.call_trees.callees.length)
|
239
|
+
call_tree = method.call_trees.callees[0]
|
240
|
+
assert_equal('String#*', call_tree.target.full_name)
|
241
|
+
assert_equal(1, call_tree.total_time)
|
242
|
+
assert_equal(0, call_tree.wait_time)
|
243
|
+
assert_equal(1, call_tree.self_time)
|
244
|
+
assert_equal(0, call_tree.children_time)
|
245
|
+
|
246
|
+
call_tree = method.call_trees.callees[1]
|
247
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
248
|
+
assert_equal(2, call_tree.total_time)
|
249
|
+
assert_equal(0, call_tree.wait_time)
|
250
|
+
assert_equal(1, call_tree.self_time)
|
251
|
+
assert_equal(1, call_tree.children_time)
|
252
|
+
|
253
|
+
# Method 7
|
254
|
+
method = methods[7]
|
255
|
+
assert_equal('String#*', method.full_name)
|
256
|
+
assert_equal(1, method.total_time)
|
257
|
+
assert_equal(0, method.wait_time)
|
258
|
+
assert_equal(1, method.self_time)
|
259
|
+
assert_equal(0, method.children_time)
|
260
|
+
|
261
|
+
assert_equal(1, method.call_trees.callers.length)
|
262
|
+
call_tree = method.call_trees.callers[0]
|
263
|
+
assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
|
264
|
+
assert_equal(1, call_tree.total_time)
|
265
|
+
assert_equal(0, call_tree.wait_time)
|
266
|
+
assert_equal(1, call_tree.self_time)
|
267
|
+
assert_equal(0, call_tree.children_time)
|
268
|
+
|
269
|
+
assert_equal(0, method.call_trees.callees.length)
|
270
|
+
|
271
|
+
# Method 8
|
272
|
+
method = methods[8]
|
273
|
+
assert_equal('String#initialize', method.full_name)
|
274
|
+
assert_equal(1, method.total_time)
|
275
|
+
assert_equal(0, method.wait_time)
|
276
|
+
assert_equal(1, method.self_time)
|
277
|
+
assert_equal(0, method.children_time)
|
278
|
+
|
279
|
+
assert_equal(1, method.call_trees.callers.length)
|
280
|
+
call_tree = method.call_trees.callers[0]
|
281
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
282
|
+
assert_equal(1, call_tree.total_time)
|
283
|
+
assert_equal(0, call_tree.wait_time)
|
284
|
+
assert_equal(1, call_tree.self_time)
|
285
|
+
assert_equal(0, call_tree.children_time)
|
286
|
+
|
287
|
+
assert_equal(0, method.call_trees.callees.length)
|
288
|
+
|
289
|
+
# Method 9
|
290
|
+
method = methods[9]
|
291
|
+
assert_equal('BasicObject#initialize', method.full_name)
|
292
|
+
assert_equal(0, method.total_time)
|
293
|
+
assert_equal(0, method.wait_time)
|
294
|
+
assert_equal(0, method.self_time)
|
295
|
+
assert_equal(0, method.children_time)
|
296
|
+
|
297
|
+
assert_equal(1, method.call_trees.callers.length)
|
298
|
+
call_tree = method.call_trees.callers[0]
|
299
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
300
|
+
assert_equal(0, call_tree.total_time)
|
301
|
+
assert_equal(0, call_tree.wait_time)
|
302
|
+
assert_equal(0, call_tree.self_time)
|
303
|
+
assert_equal(0, call_tree.children_time)
|
304
|
+
|
305
|
+
assert_equal(0, method.call_trees.callees.length)
|
306
|
+
|
307
|
+
# Method 10
|
308
|
+
method = methods[10]
|
309
|
+
assert_equal('Hash#initialize', method.full_name)
|
310
|
+
assert_equal(0, method.total_time)
|
311
|
+
assert_equal(0, method.wait_time)
|
312
|
+
assert_equal(0, method.self_time)
|
313
|
+
assert_equal(0, method.children_time)
|
314
|
+
|
315
|
+
assert_equal(1, method.call_trees.callers.length)
|
316
|
+
call_tree = method.call_trees.callers[0]
|
317
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
318
|
+
assert_equal(0, call_tree.total_time)
|
319
|
+
assert_equal(0, call_tree.wait_time)
|
320
|
+
assert_equal(0, call_tree.self_time)
|
321
|
+
assert_equal(0, call_tree.children_time)
|
322
|
+
|
323
|
+
assert_equal(0, method.call_trees.callees.length)
|
324
|
+
else
|
325
|
+
assert_equal(13, methods.length)
|
326
|
+
|
327
|
+
# Method 0
|
328
|
+
method = methods[0]
|
329
|
+
assert_equal('MeasureAllocationsTest#test_allocations', method.full_name)
|
330
|
+
assert_in_delta(20, method.total_time, 1)
|
331
|
+
assert_equal(0, method.wait_time)
|
332
|
+
assert_equal(0, method.self_time)
|
333
|
+
assert_in_delta(20, method.children_time, 1)
|
334
|
+
|
335
|
+
assert_equal(0, method.call_trees.callers.length)
|
336
|
+
|
337
|
+
assert_equal(2, method.call_trees.callees.length)
|
338
|
+
call_tree = method.call_trees.callees[0]
|
339
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
340
|
+
assert_equal(1, call_tree.total_time)
|
341
|
+
assert_equal(0, call_tree.wait_time)
|
342
|
+
assert_equal(1, call_tree.self_time)
|
343
|
+
assert_equal(0, call_tree.children_time)
|
344
|
+
|
345
|
+
call_tree = method.call_trees.callees[1]
|
346
|
+
assert_equal('Allocator#run', call_tree.target.full_name)
|
347
|
+
assert_equal(19, call_tree.total_time)
|
348
|
+
assert_equal(0, call_tree.wait_time)
|
349
|
+
assert_equal(0, call_tree.self_time)
|
350
|
+
assert_equal(19, call_tree.children_time)
|
351
|
+
|
352
|
+
# Method 1
|
353
|
+
method = methods[1]
|
354
|
+
assert_equal('Allocator#run',method.full_name)
|
355
|
+
assert_equal(19, method.total_time)
|
356
|
+
assert_equal(0, method.wait_time)
|
357
|
+
assert_equal(0, method.self_time)
|
358
|
+
assert_equal(19, method.children_time)
|
359
|
+
|
360
|
+
assert_equal(1, method.call_trees.callers.length)
|
361
|
+
call_tree = method.call_trees.callers[0]
|
362
|
+
assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
|
363
|
+
assert_equal(19, call_tree.total_time)
|
364
|
+
assert_equal(0, call_tree.wait_time)
|
365
|
+
assert_equal(0, call_tree.self_time)
|
366
|
+
assert_equal(19, call_tree.children_time)
|
367
|
+
|
368
|
+
assert_equal(3, method.call_trees.callees.length)
|
369
|
+
call_tree = method.call_trees.callees[0]
|
370
|
+
assert_equal('Allocator#make_arrays', call_tree.target.full_name)
|
371
|
+
assert_equal(10, call_tree.total_time)
|
372
|
+
assert_equal(0, call_tree.wait_time)
|
373
|
+
assert_equal(0, call_tree.self_time)
|
374
|
+
assert_equal(10, call_tree.children_time)
|
375
|
+
|
376
|
+
call_tree = method.call_trees.callees[1]
|
377
|
+
assert_equal('Allocator#make_hashes', call_tree.target.full_name)
|
378
|
+
assert_equal(5, call_tree.total_time)
|
379
|
+
assert_equal(0, call_tree.wait_time)
|
380
|
+
assert_equal(0, call_tree.self_time)
|
381
|
+
assert_equal(5, call_tree.children_time)
|
382
|
+
|
383
|
+
call_tree = method.call_trees.callees[2]
|
384
|
+
assert_equal('Allocator#make_strings', call_tree.target.full_name)
|
385
|
+
assert_equal(4, call_tree.total_time)
|
386
|
+
assert_equal(0, call_tree.wait_time)
|
387
|
+
assert_equal(1, call_tree.self_time)
|
388
|
+
assert_equal(3, call_tree.children_time)
|
389
|
+
|
390
|
+
# Method 2
|
391
|
+
method = methods[2]
|
392
|
+
assert_equal('Allocator#make_arrays', method.full_name)
|
393
|
+
assert_equal(10, method.total_time)
|
394
|
+
assert_equal(0, method.wait_time)
|
395
|
+
assert_equal(0, method.self_time)
|
396
|
+
assert_equal(10, method.children_time)
|
397
|
+
|
398
|
+
assert_equal(1, method.call_trees.callers.length)
|
399
|
+
call_tree = method.call_trees.callers[0]
|
400
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
401
|
+
assert_equal(10, call_tree.total_time)
|
402
|
+
assert_equal(0, call_tree.wait_time)
|
403
|
+
assert_equal(0, call_tree.self_time)
|
404
|
+
assert_equal(10, call_tree.children_time)
|
405
|
+
|
406
|
+
assert_equal(1, method.call_trees.callees.length)
|
407
|
+
call_tree = method.call_trees.callees[0]
|
408
|
+
assert_equal('Integer#times', call_tree.target.full_name)
|
409
|
+
assert_equal(10, call_tree.total_time)
|
410
|
+
assert_equal(0, call_tree.wait_time)
|
411
|
+
assert_equal(0, call_tree.self_time)
|
412
|
+
assert_equal(10, call_tree.children_time)
|
413
|
+
|
414
|
+
# Method 3
|
415
|
+
method = methods[3]
|
416
|
+
assert_equal('Integer#times', method.full_name)
|
417
|
+
assert_equal(10, method.total_time)
|
418
|
+
assert_equal(0, method.wait_time)
|
419
|
+
assert_equal(0, method.self_time)
|
420
|
+
assert_equal(10, method.children_time)
|
421
|
+
|
422
|
+
assert_equal(1, method.call_trees.callers.length)
|
423
|
+
call_tree = method.call_trees.callers[0]
|
424
|
+
assert_equal('Allocator#make_arrays', call_tree.parent.target.full_name)
|
425
|
+
assert_equal(10, call_tree.total_time)
|
426
|
+
assert_equal(0, call_tree.wait_time)
|
427
|
+
assert_equal(0, call_tree.self_time)
|
428
|
+
assert_equal(10, call_tree.children_time)
|
429
|
+
|
430
|
+
assert_equal(1, method.call_trees.callees.length)
|
431
|
+
call_tree = method.call_trees.callees[0]
|
432
|
+
assert_equal('<Class::Array>#new', call_tree.target.full_name)
|
433
|
+
assert_equal(10, call_tree.total_time)
|
434
|
+
assert_equal(0, call_tree.wait_time)
|
435
|
+
assert_equal(10, call_tree.self_time)
|
436
|
+
assert_equal(0, call_tree.children_time)
|
437
|
+
|
438
|
+
# Method 4
|
439
|
+
method = methods[4]
|
440
|
+
assert_equal('<Class::Array>#new', method.full_name)
|
441
|
+
assert_equal(10, method.total_time)
|
442
|
+
assert_equal(0, method.wait_time)
|
443
|
+
assert_equal(10, method.self_time)
|
444
|
+
assert_equal(0, method.children_time)
|
445
|
+
|
446
|
+
assert_equal(1, method.call_trees.callers.length)
|
447
|
+
call_tree = method.call_trees.callers[0]
|
448
|
+
assert_equal('Integer#times', call_tree.parent.target.full_name)
|
449
|
+
assert_equal(10, call_tree.total_time)
|
450
|
+
assert_equal(0, call_tree.wait_time)
|
451
|
+
assert_equal(10, call_tree.self_time)
|
452
|
+
assert_equal(0, call_tree.children_time)
|
453
|
+
|
454
|
+
assert_equal(1, method.call_trees.callees.length)
|
455
|
+
call_tree = method.call_trees.callees[0]
|
456
|
+
assert_equal('Array#initialize', call_tree.target.full_name)
|
457
|
+
assert_equal(0, call_tree.total_time)
|
458
|
+
assert_equal(0, call_tree.wait_time)
|
459
|
+
assert_equal(0, call_tree.self_time)
|
460
|
+
assert_equal(0, call_tree.children_time)
|
461
|
+
|
462
|
+
# Method 5
|
463
|
+
method = methods[5]
|
464
|
+
assert_equal('Class#new', method.full_name)
|
465
|
+
assert_equal(8, method.total_time)
|
466
|
+
assert_equal(0, method.wait_time)
|
467
|
+
assert_equal(7, method.self_time)
|
468
|
+
assert_equal(1, method.children_time)
|
469
|
+
|
470
|
+
assert_equal(3, method.call_trees.callers.length)
|
471
|
+
call_tree = method.call_trees.callers[0]
|
472
|
+
assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
|
473
|
+
assert_equal(1, call_tree.total_time)
|
474
|
+
assert_equal(0, call_tree.wait_time)
|
475
|
+
assert_equal(1, call_tree.self_time)
|
476
|
+
assert_equal(0, call_tree.children_time)
|
477
|
+
|
478
|
+
call_tree = method.call_trees.callers[1]
|
479
|
+
assert_equal('Allocator#make_hashes', call_tree.parent.target.full_name)
|
480
|
+
assert_equal(5, call_tree.total_time)
|
481
|
+
assert_equal(0, call_tree.wait_time)
|
482
|
+
assert_equal(5, call_tree.self_time)
|
483
|
+
assert_equal(0, call_tree.children_time)
|
484
|
+
|
485
|
+
call_tree = method.call_trees.callers[2]
|
486
|
+
assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
|
487
|
+
assert_equal(2, call_tree.total_time)
|
488
|
+
assert_equal(0, call_tree.wait_time)
|
489
|
+
assert_equal(1, call_tree.self_time)
|
490
|
+
assert_equal(1, call_tree.children_time)
|
491
|
+
|
492
|
+
assert_equal(3, method.call_trees.callees.length)
|
493
|
+
call_tree = method.call_trees.callees[0]
|
494
|
+
assert_equal('BasicObject#initialize', call_tree.target.full_name)
|
495
|
+
assert_equal(0, call_tree.total_time)
|
496
|
+
assert_equal(0, call_tree.wait_time)
|
497
|
+
assert_equal(0, call_tree.self_time)
|
498
|
+
assert_equal(0, call_tree.children_time)
|
499
|
+
|
500
|
+
call_tree = method.call_trees.callees[1]
|
501
|
+
assert_equal('Hash#initialize', call_tree.target.full_name)
|
502
|
+
assert_equal(0, call_tree.total_time)
|
503
|
+
assert_equal(0, call_tree.wait_time)
|
504
|
+
assert_equal(0, call_tree.self_time)
|
505
|
+
assert_equal(0, call_tree.children_time)
|
506
|
+
|
507
|
+
call_tree = method.call_trees.callees[2]
|
508
|
+
assert_equal('String#initialize', call_tree.target.full_name)
|
509
|
+
assert_equal(1, call_tree.total_time)
|
510
|
+
assert_equal(0, call_tree.wait_time)
|
511
|
+
assert_equal(1, call_tree.self_time)
|
512
|
+
assert_equal(0, call_tree.children_time)
|
513
|
+
|
514
|
+
# Method 6
|
515
|
+
method = methods[6]
|
516
|
+
assert_equal('Allocator#make_hashes', method.full_name)
|
517
|
+
assert_equal(5, method.total_time)
|
518
|
+
assert_equal(0, method.wait_time)
|
519
|
+
assert_equal(0, method.self_time)
|
520
|
+
assert_equal(5, method.children_time)
|
521
|
+
|
522
|
+
assert_equal(1, method.call_trees.callers.length)
|
523
|
+
call_tree = method.call_trees.callers[0]
|
524
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
525
|
+
assert_equal(5, call_tree.total_time)
|
526
|
+
assert_equal(0, call_tree.wait_time)
|
527
|
+
assert_equal(0, call_tree.self_time)
|
528
|
+
assert_equal(5, call_tree.children_time)
|
529
|
+
|
530
|
+
assert_equal(1, method.call_trees.callees.length)
|
531
|
+
call_tree = method.call_trees.callees[0]
|
532
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
533
|
+
assert_equal(5, call_tree.total_time)
|
534
|
+
assert_equal(0, call_tree.wait_time)
|
535
|
+
assert_equal(5, call_tree.self_time)
|
536
|
+
assert_equal(0, call_tree.children_time)
|
537
|
+
|
538
|
+
# Method 7
|
539
|
+
method = methods[7]
|
540
|
+
assert_equal('Allocator#make_strings', method.full_name)
|
541
|
+
assert_equal(4, method.total_time)
|
542
|
+
assert_equal(0, method.wait_time)
|
543
|
+
assert_equal(1, method.self_time)
|
544
|
+
assert_equal(3, method.children_time)
|
545
|
+
|
546
|
+
assert_equal(1, method.call_trees.callers.length)
|
547
|
+
call_tree = method.call_trees.callers[0]
|
548
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
549
|
+
assert_equal(4, call_tree.total_time)
|
550
|
+
assert_equal(0, call_tree.wait_time)
|
551
|
+
assert_equal(1, call_tree.self_time)
|
552
|
+
assert_equal(3, call_tree.children_time)
|
553
|
+
|
554
|
+
assert_equal(2, method.call_trees.callees.length)
|
555
|
+
call_tree = method.call_trees.callees[0]
|
556
|
+
assert_equal('String#*', call_tree.target.full_name)
|
557
|
+
assert_equal(1, call_tree.total_time)
|
558
|
+
assert_equal(0, call_tree.wait_time)
|
559
|
+
assert_equal(1, call_tree.self_time)
|
560
|
+
assert_equal(0, call_tree.children_time)
|
561
|
+
|
562
|
+
call_tree = method.call_trees.callees[1]
|
563
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
564
|
+
assert_equal(2, call_tree.total_time)
|
565
|
+
assert_equal(0, call_tree.wait_time)
|
566
|
+
assert_equal(1, call_tree.self_time)
|
567
|
+
assert_equal(1, call_tree.children_time)
|
568
|
+
|
569
|
+
# Method 8
|
570
|
+
method = methods[8]
|
571
|
+
assert_equal('String#*', method.full_name)
|
572
|
+
assert_equal(1, method.total_time)
|
573
|
+
assert_equal(0, method.wait_time)
|
574
|
+
assert_equal(1, method.self_time)
|
575
|
+
assert_equal(0, method.children_time)
|
576
|
+
|
577
|
+
assert_equal(1, method.call_trees.callers.length)
|
578
|
+
call_tree = method.call_trees.callers[0]
|
579
|
+
assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
|
580
|
+
assert_equal(1, call_tree.total_time)
|
581
|
+
assert_equal(0, call_tree.wait_time)
|
582
|
+
assert_equal(1, call_tree.self_time)
|
583
|
+
assert_equal(0, call_tree.children_time)
|
584
|
+
|
585
|
+
assert_equal(0, method.call_trees.callees.length)
|
586
|
+
|
587
|
+
# Method 9
|
588
|
+
method = methods[9]
|
589
|
+
assert_equal('String#initialize', method.full_name)
|
590
|
+
assert_equal(1, method.total_time)
|
591
|
+
assert_equal(0, method.wait_time)
|
592
|
+
assert_equal(1, method.self_time)
|
593
|
+
assert_equal(0, method.children_time)
|
594
|
+
|
595
|
+
assert_equal(1, method.call_trees.callers.length)
|
596
|
+
call_tree = method.call_trees.callers[0]
|
597
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
598
|
+
assert_equal(1, call_tree.total_time)
|
599
|
+
assert_equal(0, call_tree.wait_time)
|
600
|
+
assert_equal(1, call_tree.self_time)
|
601
|
+
assert_equal(0, call_tree.children_time)
|
602
|
+
|
603
|
+
assert_equal(0, method.call_trees.callees.length)
|
604
|
+
|
605
|
+
# Method 10
|
606
|
+
method = methods[10]
|
607
|
+
assert_equal('BasicObject#initialize', method.full_name)
|
608
|
+
assert_equal(0, method.total_time)
|
609
|
+
assert_equal(0, method.wait_time)
|
610
|
+
assert_equal(0, method.self_time)
|
611
|
+
assert_equal(0, method.children_time)
|
612
|
+
|
613
|
+
assert_equal(1, method.call_trees.callers.length)
|
614
|
+
call_tree = method.call_trees.callers[0]
|
615
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
616
|
+
assert_equal(0, call_tree.total_time)
|
617
|
+
assert_equal(0, call_tree.wait_time)
|
618
|
+
assert_equal(0, call_tree.self_time)
|
619
|
+
assert_equal(0, call_tree.children_time)
|
620
|
+
|
621
|
+
assert_equal(0, method.call_trees.callees.length)
|
622
|
+
|
623
|
+
# Method 11
|
624
|
+
method = methods[11]
|
625
|
+
assert_equal('Hash#initialize', method.full_name)
|
626
|
+
assert_equal(0, method.total_time)
|
627
|
+
assert_equal(0, method.wait_time)
|
628
|
+
assert_equal(0, method.self_time)
|
629
|
+
assert_equal(0, method.children_time)
|
630
|
+
|
631
|
+
assert_equal(1, method.call_trees.callers.length)
|
632
|
+
call_tree = method.call_trees.callers[0]
|
633
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
634
|
+
assert_equal(0, call_tree.total_time)
|
635
|
+
assert_equal(0, call_tree.wait_time)
|
636
|
+
assert_equal(0, call_tree.self_time)
|
637
|
+
assert_equal(0, call_tree.children_time)
|
638
|
+
|
639
|
+
assert_equal(0, method.call_trees.callees.length)
|
640
|
+
|
641
|
+
# Method 12
|
642
|
+
method = methods[12]
|
643
|
+
assert_equal('Array#initialize', method.full_name)
|
644
|
+
assert_equal(0, method.total_time)
|
645
|
+
assert_equal(0, method.wait_time)
|
646
|
+
assert_equal(0, method.self_time)
|
647
|
+
assert_equal(0, method.children_time)
|
648
|
+
|
649
|
+
assert_equal(1, method.call_trees.callers.length)
|
650
|
+
call_tree = method.call_trees.callers[0]
|
651
|
+
assert_equal('<Class::Array>#new', call_tree.parent.target.full_name)
|
652
|
+
assert_equal(0, call_tree.total_time)
|
653
|
+
assert_equal(0, call_tree.wait_time)
|
654
|
+
assert_equal(0, call_tree.self_time)
|
655
|
+
assert_equal(0, call_tree.children_time)
|
656
|
+
|
657
|
+
assert_equal(0, method.call_trees.callees.length)
|
658
|
+
end
|
374
659
|
end
|
375
660
|
end
|