ruby-prof 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +8 -0
- data/ext/ruby_prof/extconf.rb +23 -22
- data/ext/ruby_prof/rp_call_trees.c +296 -296
- data/ext/ruby_prof/rp_call_trees.h +28 -28
- data/ext/ruby_prof/rp_measure_allocations.c +47 -47
- data/ext/ruby_prof/rp_measure_process_time.c +64 -66
- data/ext/ruby_prof/rp_measure_wall_time.c +52 -64
- data/ext/ruby_prof/rp_method.c +551 -551
- data/ext/ruby_prof/rp_stack.c +212 -212
- data/ext/ruby_prof/ruby_prof.c +50 -50
- data/ext/ruby_prof/ruby_prof.h +3 -2
- data/ext/ruby_prof/vc/ruby_prof.vcxproj +3 -3
- data/lib/ruby-prof/compatibility.rb +113 -113
- data/lib/ruby-prof/exclude_common_methods.rb +204 -204
- data/lib/ruby-prof/printers/abstract_printer.rb +156 -138
- data/lib/ruby-prof/version.rb +3 -3
- data/ruby-prof.gemspec +66 -65
- data/test/dynamic_method_test.rb +9 -21
- data/test/enumerable_test.rb +23 -21
- data/test/exclude_methods_test.rb +363 -257
- data/test/fiber_test.rb +195 -195
- data/test/gc_test.rb +104 -102
- data/test/line_number_test.rb +426 -289
- data/test/measure_allocations_test.rb +1172 -1081
- data/test/measure_memory_test.rb +1193 -1456
- data/test/measure_process_time_test.rb +3330 -2477
- data/test/measure_wall_time_test.rb +634 -568
- data/test/merge_test.rb +146 -146
- data/test/method_info_test.rb +100 -95
- data/test/printers_test.rb +178 -135
- data/test/recursive_test.rb +796 -622
- data/test/start_stop_test.rb +4 -4
- data/test/test_helper.rb +20 -20
- data/test/thread_test.rb +229 -231
- data/test/unique_call_path_test.rb +9 -22
- data/test/yarv_test.rb +1 -5
- metadata +19 -9
- data/test/crash2.rb +0 -144
@@ -1,1081 +1,1172 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# encoding: UTF-8
|
3
|
-
|
4
|
-
require File.expand_path('../test_helper', __FILE__)
|
5
|
-
require_relative './measure_allocations'
|
6
|
-
|
7
|
-
class MeasureAllocationsTest < TestCase
|
8
|
-
def test_allocations
|
9
|
-
result = RubyProf::Profile.profile(measure_mode: RubyProf::ALLOCATIONS, track_allocations: true) do
|
10
|
-
allocator = Allocator.new
|
11
|
-
allocator.run
|
12
|
-
end
|
13
|
-
|
14
|
-
thread = result.threads.first
|
15
|
-
assert_in_delta(20, thread.total_time, 1)
|
16
|
-
|
17
|
-
methods = result.threads.first.methods.sort.reverse
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
assert_equal(0, method.
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
assert_equal(
|
35
|
-
assert_equal(
|
36
|
-
assert_equal(
|
37
|
-
assert_equal(
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
assert_equal(
|
42
|
-
assert_equal(
|
43
|
-
assert_equal(0, call_tree.
|
44
|
-
assert_equal(
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
assert_equal(
|
50
|
-
assert_equal(
|
51
|
-
assert_equal(0, method.
|
52
|
-
assert_equal(
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
assert_equal(
|
58
|
-
assert_equal(
|
59
|
-
assert_equal(0, call_tree.
|
60
|
-
assert_equal(
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
assert_equal(
|
66
|
-
assert_equal(
|
67
|
-
assert_equal(0, call_tree.
|
68
|
-
assert_equal(
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
assert_equal(
|
73
|
-
assert_equal(
|
74
|
-
assert_equal(0, call_tree.
|
75
|
-
assert_equal(
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
assert_equal(
|
80
|
-
assert_equal(
|
81
|
-
assert_equal(
|
82
|
-
assert_equal(
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
assert_equal(
|
88
|
-
assert_equal(
|
89
|
-
assert_equal(
|
90
|
-
assert_equal(
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
assert_equal(
|
96
|
-
assert_equal(
|
97
|
-
assert_equal(
|
98
|
-
assert_equal(0, call_tree.
|
99
|
-
|
100
|
-
|
101
|
-
assert_equal(
|
102
|
-
|
103
|
-
assert_equal(
|
104
|
-
assert_equal(10, call_tree.
|
105
|
-
assert_equal(0, call_tree.
|
106
|
-
|
107
|
-
call_tree
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
assert_equal(
|
112
|
-
assert_equal(
|
113
|
-
|
114
|
-
|
115
|
-
assert_equal(
|
116
|
-
|
117
|
-
assert_equal(
|
118
|
-
|
119
|
-
assert_equal(
|
120
|
-
|
121
|
-
assert_equal(
|
122
|
-
call_tree
|
123
|
-
assert_equal(
|
124
|
-
|
125
|
-
assert_equal(
|
126
|
-
|
127
|
-
assert_equal(
|
128
|
-
|
129
|
-
call_tree
|
130
|
-
assert_equal(
|
131
|
-
assert_equal(0, call_tree.
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
assert_equal(
|
138
|
-
assert_equal(
|
139
|
-
assert_equal(0,
|
140
|
-
|
141
|
-
assert_equal(
|
142
|
-
|
143
|
-
call_tree
|
144
|
-
assert_equal(
|
145
|
-
assert_equal(
|
146
|
-
assert_equal(
|
147
|
-
assert_equal(
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
assert_equal(
|
153
|
-
assert_equal(
|
154
|
-
assert_equal(0,
|
155
|
-
assert_equal(0,
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
assert_equal(
|
161
|
-
assert_equal(
|
162
|
-
assert_equal(
|
163
|
-
assert_equal(
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
call_tree
|
168
|
-
assert_equal(
|
169
|
-
assert_equal(
|
170
|
-
assert_equal(
|
171
|
-
assert_equal(0, call_tree.
|
172
|
-
|
173
|
-
|
174
|
-
#
|
175
|
-
|
176
|
-
assert_equal(
|
177
|
-
assert_equal(
|
178
|
-
assert_equal(0,
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
assert_equal(
|
183
|
-
call_tree
|
184
|
-
assert_equal(
|
185
|
-
assert_equal(
|
186
|
-
|
187
|
-
assert_equal(
|
188
|
-
|
189
|
-
|
190
|
-
assert_equal(
|
191
|
-
call_tree
|
192
|
-
assert_equal(
|
193
|
-
assert_equal(
|
194
|
-
|
195
|
-
|
196
|
-
assert_equal(
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
assert_equal(
|
201
|
-
|
202
|
-
|
203
|
-
assert_equal(
|
204
|
-
assert_equal(
|
205
|
-
|
206
|
-
assert_equal(1,
|
207
|
-
call_tree
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
assert_equal(
|
212
|
-
assert_equal(5,
|
213
|
-
|
214
|
-
assert_equal(
|
215
|
-
|
216
|
-
|
217
|
-
assert_equal(
|
218
|
-
|
219
|
-
assert_equal(
|
220
|
-
assert_equal(
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
assert_equal(
|
226
|
-
|
227
|
-
assert_equal(
|
228
|
-
assert_equal(
|
229
|
-
|
230
|
-
assert_equal(
|
231
|
-
call_tree
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
assert_equal(
|
236
|
-
assert_equal(
|
237
|
-
|
238
|
-
assert_equal(
|
239
|
-
|
240
|
-
|
241
|
-
assert_equal(1,
|
242
|
-
|
243
|
-
assert_equal(
|
244
|
-
assert_equal(
|
245
|
-
|
246
|
-
call_tree
|
247
|
-
assert_equal(
|
248
|
-
|
249
|
-
assert_equal(
|
250
|
-
|
251
|
-
assert_equal(
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
assert_equal(
|
256
|
-
|
257
|
-
|
258
|
-
assert_equal(
|
259
|
-
assert_equal(
|
260
|
-
|
261
|
-
assert_equal(1,
|
262
|
-
call_tree
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
assert_equal(
|
267
|
-
assert_equal(
|
268
|
-
|
269
|
-
assert_equal(
|
270
|
-
|
271
|
-
|
272
|
-
method
|
273
|
-
|
274
|
-
assert_equal(
|
275
|
-
assert_equal(
|
276
|
-
assert_equal(
|
277
|
-
assert_equal(
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
assert_equal(
|
285
|
-
assert_equal(
|
286
|
-
|
287
|
-
assert_equal(
|
288
|
-
|
289
|
-
|
290
|
-
method
|
291
|
-
|
292
|
-
assert_equal(
|
293
|
-
assert_equal(
|
294
|
-
assert_equal(0,
|
295
|
-
assert_equal(
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
assert_equal(
|
303
|
-
assert_equal(0,
|
304
|
-
|
305
|
-
assert_equal(0, method.
|
306
|
-
|
307
|
-
|
308
|
-
method
|
309
|
-
|
310
|
-
assert_equal(
|
311
|
-
assert_equal(0,
|
312
|
-
assert_equal(0,
|
313
|
-
assert_equal(0,
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
assert_equal(
|
321
|
-
assert_equal(0,
|
322
|
-
|
323
|
-
assert_equal(0, method.
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
assert_equal(
|
330
|
-
|
331
|
-
assert_equal(0,
|
332
|
-
assert_equal(0,
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
assert_equal(
|
340
|
-
assert_equal(
|
341
|
-
assert_equal(0,
|
342
|
-
assert_equal(
|
343
|
-
|
344
|
-
|
345
|
-
call_tree = method.call_trees.
|
346
|
-
assert_equal('
|
347
|
-
assert_equal(
|
348
|
-
assert_equal(0, call_tree.wait_time)
|
349
|
-
assert_equal(0, call_tree.self_time)
|
350
|
-
assert_equal(
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
assert_equal(
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
assert_equal(
|
359
|
-
|
360
|
-
assert_equal(
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
assert_equal(0,
|
365
|
-
|
366
|
-
assert_equal(
|
367
|
-
|
368
|
-
assert_equal(
|
369
|
-
call_tree
|
370
|
-
assert_equal(
|
371
|
-
assert_equal(
|
372
|
-
assert_equal(0, call_tree.
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
call_tree
|
377
|
-
assert_equal(
|
378
|
-
assert_equal(
|
379
|
-
assert_equal(
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
assert_equal(
|
385
|
-
assert_equal(
|
386
|
-
assert_equal(0,
|
387
|
-
assert_equal(
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
assert_equal(
|
393
|
-
assert_equal(
|
394
|
-
assert_equal(0,
|
395
|
-
assert_equal(
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
call_tree
|
400
|
-
assert_equal(
|
401
|
-
assert_equal(
|
402
|
-
assert_equal(0, call_tree.
|
403
|
-
assert_equal(
|
404
|
-
|
405
|
-
|
406
|
-
assert_equal(
|
407
|
-
call_tree
|
408
|
-
assert_equal(
|
409
|
-
assert_equal(
|
410
|
-
assert_equal(
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
assert_equal(
|
417
|
-
assert_equal(
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
assert_equal(
|
423
|
-
|
424
|
-
assert_equal(
|
425
|
-
assert_equal(10,
|
426
|
-
|
427
|
-
assert_equal(
|
428
|
-
|
429
|
-
|
430
|
-
assert_equal(
|
431
|
-
call_tree
|
432
|
-
assert_equal(
|
433
|
-
assert_equal(10, call_tree.
|
434
|
-
|
435
|
-
assert_equal(
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
assert_equal(
|
441
|
-
assert_equal(10,
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
assert_equal(
|
447
|
-
|
448
|
-
assert_equal(
|
449
|
-
assert_equal(10,
|
450
|
-
|
451
|
-
assert_equal(
|
452
|
-
|
453
|
-
|
454
|
-
assert_equal(
|
455
|
-
call_tree
|
456
|
-
assert_equal(
|
457
|
-
assert_equal(
|
458
|
-
|
459
|
-
assert_equal(
|
460
|
-
|
461
|
-
|
462
|
-
#
|
463
|
-
|
464
|
-
assert_equal(
|
465
|
-
assert_equal(
|
466
|
-
assert_equal(0,
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
assert_equal(
|
471
|
-
call_tree
|
472
|
-
assert_equal(
|
473
|
-
assert_equal(
|
474
|
-
|
475
|
-
|
476
|
-
assert_equal(
|
477
|
-
|
478
|
-
call_tree
|
479
|
-
assert_equal(
|
480
|
-
assert_equal(
|
481
|
-
|
482
|
-
|
483
|
-
assert_equal(
|
484
|
-
|
485
|
-
call_tree
|
486
|
-
assert_equal(
|
487
|
-
assert_equal(
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
assert_equal(
|
493
|
-
|
494
|
-
assert_equal(
|
495
|
-
assert_equal(0,
|
496
|
-
|
497
|
-
assert_equal(
|
498
|
-
|
499
|
-
|
500
|
-
call_tree
|
501
|
-
assert_equal(
|
502
|
-
assert_equal(
|
503
|
-
assert_equal(0, call_tree.
|
504
|
-
|
505
|
-
assert_equal(
|
506
|
-
|
507
|
-
call_tree
|
508
|
-
assert_equal(
|
509
|
-
assert_equal(
|
510
|
-
assert_equal(0, call_tree.
|
511
|
-
assert_equal(
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
method
|
516
|
-
assert_equal(
|
517
|
-
assert_equal(
|
518
|
-
assert_equal(
|
519
|
-
assert_equal(0, method.
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
call_tree
|
524
|
-
assert_equal(
|
525
|
-
assert_equal(
|
526
|
-
assert_equal(
|
527
|
-
assert_equal(0, call_tree.
|
528
|
-
|
529
|
-
|
530
|
-
assert_equal(
|
531
|
-
call_tree
|
532
|
-
assert_equal(
|
533
|
-
assert_equal(5, call_tree.
|
534
|
-
assert_equal(0, call_tree.
|
535
|
-
|
536
|
-
assert_equal(
|
537
|
-
|
538
|
-
#
|
539
|
-
|
540
|
-
assert_equal(
|
541
|
-
assert_equal(
|
542
|
-
assert_equal(0,
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
assert_equal(
|
547
|
-
call_tree
|
548
|
-
assert_equal(
|
549
|
-
assert_equal(
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
assert_equal(
|
555
|
-
|
556
|
-
assert_equal(
|
557
|
-
assert_equal(
|
558
|
-
|
559
|
-
assert_equal(1,
|
560
|
-
|
561
|
-
|
562
|
-
call_tree
|
563
|
-
assert_equal(
|
564
|
-
assert_equal(
|
565
|
-
assert_equal(
|
566
|
-
|
567
|
-
assert_equal(1,
|
568
|
-
|
569
|
-
#
|
570
|
-
|
571
|
-
assert_equal(
|
572
|
-
assert_equal(
|
573
|
-
assert_equal(0,
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
assert_equal(
|
578
|
-
|
579
|
-
assert_equal(
|
580
|
-
assert_equal(1,
|
581
|
-
assert_equal(
|
582
|
-
|
583
|
-
assert_equal(
|
584
|
-
|
585
|
-
assert_equal(
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
assert_equal(
|
590
|
-
|
591
|
-
assert_equal(
|
592
|
-
|
593
|
-
assert_equal(
|
594
|
-
|
595
|
-
assert_equal(
|
596
|
-
call_tree
|
597
|
-
assert_equal(
|
598
|
-
|
599
|
-
|
600
|
-
assert_equal(
|
601
|
-
assert_equal(
|
602
|
-
|
603
|
-
assert_equal(
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
assert_equal(
|
609
|
-
assert_equal(
|
610
|
-
assert_equal(0, method.
|
611
|
-
assert_equal(
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
assert_equal(
|
617
|
-
assert_equal(
|
618
|
-
assert_equal(0, call_tree.
|
619
|
-
assert_equal(
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
assert_equal('
|
626
|
-
assert_equal(
|
627
|
-
assert_equal(0,
|
628
|
-
assert_equal(
|
629
|
-
assert_equal(0,
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
assert_equal('
|
634
|
-
assert_equal(
|
635
|
-
assert_equal(0,
|
636
|
-
assert_equal(
|
637
|
-
assert_equal(0,
|
638
|
-
|
639
|
-
assert_equal(
|
640
|
-
|
641
|
-
#
|
642
|
-
|
643
|
-
assert_equal(
|
644
|
-
assert_equal(
|
645
|
-
assert_equal(0,
|
646
|
-
|
647
|
-
assert_equal(0, method.
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
assert_equal('
|
652
|
-
assert_equal(
|
653
|
-
assert_equal(0,
|
654
|
-
assert_equal(
|
655
|
-
assert_equal(0,
|
656
|
-
|
657
|
-
assert_equal(
|
658
|
-
|
659
|
-
assert_equal(
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
assert_equal(
|
664
|
-
|
665
|
-
assert_equal(0, method.
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
assert_equal(
|
670
|
-
|
671
|
-
assert_equal(
|
672
|
-
|
673
|
-
assert_equal(
|
674
|
-
|
675
|
-
assert_equal(
|
676
|
-
|
677
|
-
assert_equal(
|
678
|
-
|
679
|
-
call_tree
|
680
|
-
assert_equal(
|
681
|
-
assert_equal(
|
682
|
-
|
683
|
-
assert_equal(0,
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
method
|
688
|
-
assert_equal(
|
689
|
-
assert_equal(
|
690
|
-
assert_equal(0, method.
|
691
|
-
assert_equal(0, method.
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
call_tree
|
696
|
-
assert_equal(
|
697
|
-
assert_equal(
|
698
|
-
assert_equal(0, call_tree.
|
699
|
-
assert_equal(0, call_tree.
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
assert_equal(
|
706
|
-
assert_equal(0,
|
707
|
-
assert_equal(0,
|
708
|
-
assert_equal(
|
709
|
-
|
710
|
-
|
711
|
-
assert_equal(
|
712
|
-
|
713
|
-
assert_equal(
|
714
|
-
assert_equal(0, call_tree.
|
715
|
-
assert_equal(
|
716
|
-
|
717
|
-
call_tree
|
718
|
-
|
719
|
-
assert_equal(
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
method
|
726
|
-
assert_equal(
|
727
|
-
assert_equal(
|
728
|
-
|
729
|
-
assert_equal(
|
730
|
-
|
731
|
-
|
732
|
-
assert_equal(
|
733
|
-
call_tree
|
734
|
-
assert_equal(
|
735
|
-
assert_equal(
|
736
|
-
|
737
|
-
assert_equal(0,
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
assert_equal(
|
743
|
-
assert_equal(
|
744
|
-
assert_equal(0,
|
745
|
-
assert_equal(0,
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
assert_equal(
|
751
|
-
assert_equal(
|
752
|
-
assert_equal(0,
|
753
|
-
assert_equal(0,
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
assert_equal(
|
760
|
-
assert_equal(0,
|
761
|
-
assert_equal(0,
|
762
|
-
assert_equal(
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
call_tree = method.call_trees.
|
767
|
-
assert_equal('
|
768
|
-
assert_equal(0, call_tree.total_time)
|
769
|
-
assert_equal(0, call_tree.wait_time)
|
770
|
-
assert_equal(0, call_tree.self_time)
|
771
|
-
assert_equal(0, call_tree.children_time)
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
assert_equal(
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
assert_equal(
|
782
|
-
assert_equal(
|
783
|
-
|
784
|
-
|
785
|
-
assert_equal(0,
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
assert_equal(
|
790
|
-
assert_equal(
|
791
|
-
assert_equal(0, call_tree.
|
792
|
-
assert_equal(
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
assert_equal('
|
797
|
-
assert_equal(
|
798
|
-
assert_equal(0,
|
799
|
-
assert_equal(
|
800
|
-
assert_equal(
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
assert_equal('
|
805
|
-
assert_equal(
|
806
|
-
assert_equal(0,
|
807
|
-
assert_equal(
|
808
|
-
assert_equal(
|
809
|
-
|
810
|
-
assert_equal(1, method.call_trees.
|
811
|
-
call_tree = method.call_trees.
|
812
|
-
assert_equal('
|
813
|
-
assert_equal(
|
814
|
-
assert_equal(0, call_tree.wait_time)
|
815
|
-
assert_equal(0, call_tree.self_time)
|
816
|
-
assert_equal(
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
assert_equal('
|
821
|
-
assert_equal(
|
822
|
-
assert_equal(0,
|
823
|
-
assert_equal(
|
824
|
-
assert_equal(
|
825
|
-
|
826
|
-
|
827
|
-
call_tree
|
828
|
-
assert_equal(
|
829
|
-
assert_equal(
|
830
|
-
assert_equal(0, call_tree.
|
831
|
-
assert_equal(
|
832
|
-
|
833
|
-
|
834
|
-
call_tree
|
835
|
-
assert_equal(
|
836
|
-
assert_equal(
|
837
|
-
assert_equal(
|
838
|
-
assert_equal(
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
assert_equal(
|
844
|
-
assert_equal(0,
|
845
|
-
assert_equal(0,
|
846
|
-
assert_equal(
|
847
|
-
|
848
|
-
|
849
|
-
call_tree = method.call_trees.
|
850
|
-
assert_equal('
|
851
|
-
assert_equal(
|
852
|
-
assert_equal(0, call_tree.wait_time)
|
853
|
-
assert_equal(0, call_tree.self_time)
|
854
|
-
assert_equal(
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
assert_equal('
|
859
|
-
assert_equal(
|
860
|
-
assert_equal(0,
|
861
|
-
assert_equal(0,
|
862
|
-
assert_equal(
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
assert_equal('
|
867
|
-
assert_equal(
|
868
|
-
assert_equal(0,
|
869
|
-
assert_equal(0,
|
870
|
-
assert_equal(
|
871
|
-
|
872
|
-
assert_equal(1, method.call_trees.
|
873
|
-
call_tree = method.call_trees.
|
874
|
-
assert_equal('
|
875
|
-
assert_equal(
|
876
|
-
assert_equal(0, call_tree.wait_time)
|
877
|
-
assert_equal(
|
878
|
-
assert_equal(
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
assert_equal(
|
884
|
-
assert_equal(0,
|
885
|
-
assert_equal(
|
886
|
-
assert_equal(
|
887
|
-
|
888
|
-
|
889
|
-
call_tree = method.call_trees.
|
890
|
-
assert_equal('
|
891
|
-
assert_equal(
|
892
|
-
assert_equal(0, call_tree.wait_time)
|
893
|
-
assert_equal(
|
894
|
-
assert_equal(
|
895
|
-
|
896
|
-
|
897
|
-
call_tree
|
898
|
-
assert_equal(
|
899
|
-
assert_equal(
|
900
|
-
assert_equal(0, call_tree.
|
901
|
-
assert_equal(
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
assert_equal('<Class::
|
906
|
-
assert_equal(
|
907
|
-
assert_equal(0,
|
908
|
-
assert_equal(
|
909
|
-
assert_equal(
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
assert_equal('
|
914
|
-
assert_equal(
|
915
|
-
assert_equal(0,
|
916
|
-
assert_equal(
|
917
|
-
assert_equal(
|
918
|
-
|
919
|
-
assert_equal(1, method.call_trees.
|
920
|
-
call_tree = method.call_trees.
|
921
|
-
assert_equal('
|
922
|
-
assert_equal(
|
923
|
-
assert_equal(0, call_tree.wait_time)
|
924
|
-
assert_equal(
|
925
|
-
assert_equal(
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
assert_equal(
|
931
|
-
assert_equal(
|
932
|
-
assert_equal(
|
933
|
-
assert_equal(
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
assert_equal(
|
939
|
-
assert_equal(
|
940
|
-
assert_equal(
|
941
|
-
assert_equal(
|
942
|
-
|
943
|
-
|
944
|
-
assert_equal(
|
945
|
-
call_tree
|
946
|
-
assert_equal(
|
947
|
-
assert_equal(
|
948
|
-
assert_equal(0, call_tree.
|
949
|
-
|
950
|
-
assert_equal(
|
951
|
-
|
952
|
-
assert_equal(
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
assert_equal(
|
957
|
-
|
958
|
-
|
959
|
-
assert_equal(
|
960
|
-
assert_equal(0,
|
961
|
-
|
962
|
-
assert_equal(
|
963
|
-
call_tree
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
assert_equal(
|
968
|
-
assert_equal(
|
969
|
-
|
970
|
-
assert_equal(0, method.
|
971
|
-
|
972
|
-
|
973
|
-
method
|
974
|
-
|
975
|
-
assert_equal(
|
976
|
-
assert_equal(
|
977
|
-
assert_equal(0,
|
978
|
-
assert_equal(0,
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
assert_equal(
|
984
|
-
assert_equal(
|
985
|
-
assert_equal(0, call_tree.
|
986
|
-
assert_equal(
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
method
|
992
|
-
assert_equal(
|
993
|
-
assert_equal(0, method.
|
994
|
-
assert_equal(
|
995
|
-
assert_equal(
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
call_tree
|
1000
|
-
assert_equal(
|
1001
|
-
assert_equal(0, call_tree.
|
1002
|
-
assert_equal(
|
1003
|
-
assert_equal(
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
assert_equal(
|
1011
|
-
assert_equal(0,
|
1012
|
-
|
1013
|
-
|
1014
|
-
assert_equal(
|
1015
|
-
|
1016
|
-
assert_equal(
|
1017
|
-
call_tree
|
1018
|
-
assert_equal(
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
assert_equal(
|
1023
|
-
|
1024
|
-
assert_equal(0, method.
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
assert_equal(
|
1029
|
-
|
1030
|
-
assert_equal(
|
1031
|
-
assert_equal(
|
1032
|
-
assert_equal(0,
|
1033
|
-
|
1034
|
-
assert_equal(1,
|
1035
|
-
|
1036
|
-
assert_equal(
|
1037
|
-
|
1038
|
-
|
1039
|
-
assert_equal(
|
1040
|
-
assert_equal(
|
1041
|
-
|
1042
|
-
assert_equal(
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
assert_equal(
|
1048
|
-
assert_equal(
|
1049
|
-
assert_equal(0, method.
|
1050
|
-
assert_equal(
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
assert_equal(
|
1056
|
-
assert_equal(
|
1057
|
-
assert_equal(0, call_tree.
|
1058
|
-
assert_equal(
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
assert_equal(
|
1066
|
-
assert_equal(
|
1067
|
-
assert_equal(0, method.
|
1068
|
-
assert_equal(
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
assert_equal(
|
1074
|
-
assert_equal(
|
1075
|
-
assert_equal(0, call_tree.
|
1076
|
-
assert_equal(
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
|
4
|
+
require File.expand_path('../test_helper', __FILE__)
|
5
|
+
require_relative './measure_allocations'
|
6
|
+
|
7
|
+
class MeasureAllocationsTest < TestCase
|
8
|
+
def test_allocations
|
9
|
+
result = RubyProf::Profile.profile(measure_mode: RubyProf::ALLOCATIONS, track_allocations: true) do
|
10
|
+
allocator = Allocator.new
|
11
|
+
allocator.run
|
12
|
+
end
|
13
|
+
|
14
|
+
thread = result.threads.first
|
15
|
+
assert_in_delta(20, thread.total_time, 1)
|
16
|
+
|
17
|
+
methods = result.threads.first.methods.sort.reverse
|
18
|
+
|
19
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.3')
|
20
|
+
assert_equal(13, methods.length)
|
21
|
+
|
22
|
+
# Method 0
|
23
|
+
method = methods[0]
|
24
|
+
assert_equal('MeasureAllocationsTest#test_allocations', method.full_name)
|
25
|
+
assert_in_delta(20, method.total_time, 1)
|
26
|
+
assert_equal(0, method.wait_time)
|
27
|
+
assert_equal(0, method.self_time)
|
28
|
+
assert_in_delta(20, method.children_time, 1)
|
29
|
+
|
30
|
+
assert_equal(0, method.call_trees.callers.length)
|
31
|
+
|
32
|
+
assert_equal(2, method.call_trees.callees.length)
|
33
|
+
call_tree = method.call_trees.callees[0]
|
34
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
35
|
+
assert_equal(1, call_tree.total_time)
|
36
|
+
assert_equal(0, call_tree.wait_time)
|
37
|
+
assert_equal(1, call_tree.self_time)
|
38
|
+
assert_equal(0, call_tree.children_time)
|
39
|
+
|
40
|
+
call_tree = method.call_trees.callees[1]
|
41
|
+
assert_equal('Allocator#run', call_tree.target.full_name)
|
42
|
+
assert_equal(19, call_tree.total_time)
|
43
|
+
assert_equal(0, call_tree.wait_time)
|
44
|
+
assert_equal(0, call_tree.self_time)
|
45
|
+
assert_equal(19, call_tree.children_time)
|
46
|
+
|
47
|
+
# Method 1
|
48
|
+
method = methods[1]
|
49
|
+
assert_equal('Allocator#run',method.full_name)
|
50
|
+
assert_equal(19, method.total_time)
|
51
|
+
assert_equal(0, method.wait_time)
|
52
|
+
assert_equal(0, method.self_time)
|
53
|
+
assert_equal(19, method.children_time)
|
54
|
+
|
55
|
+
assert_equal(1, method.call_trees.callers.length)
|
56
|
+
call_tree = method.call_trees.callers[0]
|
57
|
+
assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
|
58
|
+
assert_equal(19, call_tree.total_time)
|
59
|
+
assert_equal(0, call_tree.wait_time)
|
60
|
+
assert_equal(0, call_tree.self_time)
|
61
|
+
assert_equal(19, call_tree.children_time)
|
62
|
+
|
63
|
+
assert_equal(3, method.call_trees.callees.length)
|
64
|
+
call_tree = method.call_trees.callees[0]
|
65
|
+
assert_equal('Allocator#make_arrays', call_tree.target.full_name)
|
66
|
+
assert_equal(10, call_tree.total_time)
|
67
|
+
assert_equal(0, call_tree.wait_time)
|
68
|
+
assert_equal(0, call_tree.self_time)
|
69
|
+
assert_equal(10, call_tree.children_time)
|
70
|
+
|
71
|
+
call_tree = method.call_trees.callees[1]
|
72
|
+
assert_equal('Allocator#make_hashes', call_tree.target.full_name)
|
73
|
+
assert_equal(5, call_tree.total_time)
|
74
|
+
assert_equal(0, call_tree.wait_time)
|
75
|
+
assert_equal(0, call_tree.self_time)
|
76
|
+
assert_equal(5, call_tree.children_time)
|
77
|
+
|
78
|
+
call_tree = method.call_trees.callees[2]
|
79
|
+
assert_equal('Allocator#make_strings', call_tree.target.full_name)
|
80
|
+
assert_equal(4, call_tree.total_time)
|
81
|
+
assert_equal(0, call_tree.wait_time)
|
82
|
+
assert_equal(1, call_tree.self_time)
|
83
|
+
assert_equal(3, call_tree.children_time)
|
84
|
+
|
85
|
+
# Method 2
|
86
|
+
method = methods[2]
|
87
|
+
assert_equal('Allocator#make_arrays', method.full_name)
|
88
|
+
assert_equal(10, method.total_time)
|
89
|
+
assert_equal(0, method.wait_time)
|
90
|
+
assert_equal(0, method.self_time)
|
91
|
+
assert_equal(10, method.children_time)
|
92
|
+
|
93
|
+
assert_equal(1, method.call_trees.callers.length)
|
94
|
+
call_tree = method.call_trees.callers[0]
|
95
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
96
|
+
assert_equal(10, call_tree.total_time)
|
97
|
+
assert_equal(0, call_tree.wait_time)
|
98
|
+
assert_equal(0, call_tree.self_time)
|
99
|
+
assert_equal(10, call_tree.children_time)
|
100
|
+
|
101
|
+
assert_equal(1, method.call_trees.callees.length)
|
102
|
+
call_tree = method.call_trees.callees[0]
|
103
|
+
assert_equal('Integer#times', call_tree.target.full_name)
|
104
|
+
assert_equal(10, call_tree.total_time)
|
105
|
+
assert_equal(0, call_tree.wait_time)
|
106
|
+
assert_equal(0, call_tree.self_time)
|
107
|
+
assert_equal(10, call_tree.children_time)
|
108
|
+
|
109
|
+
# Method 3
|
110
|
+
method = methods[3]
|
111
|
+
assert_equal('Integer#times', method.full_name)
|
112
|
+
assert_equal(10, method.total_time)
|
113
|
+
assert_equal(0, method.wait_time)
|
114
|
+
assert_equal(0, method.self_time)
|
115
|
+
assert_equal(10, method.children_time)
|
116
|
+
|
117
|
+
assert_equal(1, method.call_trees.callers.length)
|
118
|
+
call_tree = method.call_trees.callers[0]
|
119
|
+
assert_equal('Allocator#make_arrays', call_tree.parent.target.full_name)
|
120
|
+
assert_equal(10, call_tree.total_time)
|
121
|
+
assert_equal(0, call_tree.wait_time)
|
122
|
+
assert_equal(0, call_tree.self_time)
|
123
|
+
assert_equal(10, call_tree.children_time)
|
124
|
+
|
125
|
+
assert_equal(1, method.call_trees.callees.length)
|
126
|
+
call_tree = method.call_trees.callees[0]
|
127
|
+
assert_equal('<Class::Array>#new', call_tree.target.full_name)
|
128
|
+
assert_equal(10, call_tree.total_time)
|
129
|
+
assert_equal(0, call_tree.wait_time)
|
130
|
+
assert_equal(10, call_tree.self_time)
|
131
|
+
assert_equal(0, call_tree.children_time)
|
132
|
+
|
133
|
+
# Method 4
|
134
|
+
method = methods[4]
|
135
|
+
assert_equal('<Class::Array>#new', method.full_name)
|
136
|
+
assert_equal(10, method.total_time)
|
137
|
+
assert_equal(0, method.wait_time)
|
138
|
+
assert_equal(10, method.self_time)
|
139
|
+
assert_equal(0, method.children_time)
|
140
|
+
|
141
|
+
assert_equal(1, method.call_trees.callers.length)
|
142
|
+
call_tree = method.call_trees.callers[0]
|
143
|
+
assert_equal('Integer#times', call_tree.parent.target.full_name)
|
144
|
+
assert_equal(10, call_tree.total_time)
|
145
|
+
assert_equal(0, call_tree.wait_time)
|
146
|
+
assert_equal(10, call_tree.self_time)
|
147
|
+
assert_equal(0, call_tree.children_time)
|
148
|
+
|
149
|
+
assert_equal(1, method.call_trees.callees.length)
|
150
|
+
call_tree = method.call_trees.callees[0]
|
151
|
+
assert_equal('Array#initialize', call_tree.target.full_name)
|
152
|
+
assert_equal(0, call_tree.total_time)
|
153
|
+
assert_equal(0, call_tree.wait_time)
|
154
|
+
assert_equal(0, call_tree.self_time)
|
155
|
+
assert_equal(0, call_tree.children_time)
|
156
|
+
|
157
|
+
# Method 5
|
158
|
+
method = methods[5]
|
159
|
+
assert_equal('Class#new', method.full_name)
|
160
|
+
assert_equal(8, method.total_time)
|
161
|
+
assert_equal(0, method.wait_time)
|
162
|
+
assert_equal(7, method.self_time)
|
163
|
+
assert_equal(1, method.children_time)
|
164
|
+
|
165
|
+
assert_equal(3, method.call_trees.callers.length)
|
166
|
+
call_tree = method.call_trees.callers[0]
|
167
|
+
assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
|
168
|
+
assert_equal(1, call_tree.total_time)
|
169
|
+
assert_equal(0, call_tree.wait_time)
|
170
|
+
assert_equal(1, call_tree.self_time)
|
171
|
+
assert_equal(0, call_tree.children_time)
|
172
|
+
|
173
|
+
call_tree = method.call_trees.callers[1]
|
174
|
+
assert_equal('Allocator#make_hashes', call_tree.parent.target.full_name)
|
175
|
+
assert_equal(5, call_tree.total_time)
|
176
|
+
assert_equal(0, call_tree.wait_time)
|
177
|
+
assert_equal(5, call_tree.self_time)
|
178
|
+
assert_equal(0, call_tree.children_time)
|
179
|
+
|
180
|
+
call_tree = method.call_trees.callers[2]
|
181
|
+
assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
|
182
|
+
assert_equal(2, call_tree.total_time)
|
183
|
+
assert_equal(0, call_tree.wait_time)
|
184
|
+
assert_equal(1, call_tree.self_time)
|
185
|
+
assert_equal(1, call_tree.children_time)
|
186
|
+
|
187
|
+
assert_equal(3, method.call_trees.callees.length)
|
188
|
+
call_tree = method.call_trees.callees[0]
|
189
|
+
assert_equal('BasicObject#initialize', call_tree.target.full_name)
|
190
|
+
assert_equal(0, call_tree.total_time)
|
191
|
+
assert_equal(0, call_tree.wait_time)
|
192
|
+
assert_equal(0, call_tree.self_time)
|
193
|
+
assert_equal(0, call_tree.children_time)
|
194
|
+
|
195
|
+
call_tree = method.call_trees.callees[1]
|
196
|
+
assert_equal('Hash#initialize', call_tree.target.full_name)
|
197
|
+
assert_equal(0, call_tree.total_time)
|
198
|
+
assert_equal(0, call_tree.wait_time)
|
199
|
+
assert_equal(0, call_tree.self_time)
|
200
|
+
assert_equal(0, call_tree.children_time)
|
201
|
+
|
202
|
+
call_tree = method.call_trees.callees[2]
|
203
|
+
assert_equal('String#initialize', call_tree.target.full_name)
|
204
|
+
assert_equal(1, call_tree.total_time)
|
205
|
+
assert_equal(0, call_tree.wait_time)
|
206
|
+
assert_equal(1, call_tree.self_time)
|
207
|
+
assert_equal(0, call_tree.children_time)
|
208
|
+
|
209
|
+
# Method 6
|
210
|
+
method = methods[6]
|
211
|
+
assert_equal('Allocator#make_hashes', method.full_name)
|
212
|
+
assert_equal(5, method.total_time)
|
213
|
+
assert_equal(0, method.wait_time)
|
214
|
+
assert_equal(0, method.self_time)
|
215
|
+
assert_equal(5, method.children_time)
|
216
|
+
|
217
|
+
assert_equal(1, method.call_trees.callers.length)
|
218
|
+
call_tree = method.call_trees.callers[0]
|
219
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
220
|
+
assert_equal(5, call_tree.total_time)
|
221
|
+
assert_equal(0, call_tree.wait_time)
|
222
|
+
assert_equal(0, call_tree.self_time)
|
223
|
+
assert_equal(5, call_tree.children_time)
|
224
|
+
|
225
|
+
assert_equal(1, method.call_trees.callees.length)
|
226
|
+
call_tree = method.call_trees.callees[0]
|
227
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
228
|
+
assert_equal(5, call_tree.total_time)
|
229
|
+
assert_equal(0, call_tree.wait_time)
|
230
|
+
assert_equal(5, call_tree.self_time)
|
231
|
+
assert_equal(0, call_tree.children_time)
|
232
|
+
|
233
|
+
# Method 7
|
234
|
+
method = methods[7]
|
235
|
+
assert_equal('Allocator#make_strings', method.full_name)
|
236
|
+
assert_equal(4, method.total_time)
|
237
|
+
assert_equal(0, method.wait_time)
|
238
|
+
assert_equal(1, method.self_time)
|
239
|
+
assert_equal(3, method.children_time)
|
240
|
+
|
241
|
+
assert_equal(1, method.call_trees.callers.length)
|
242
|
+
call_tree = method.call_trees.callers[0]
|
243
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
244
|
+
assert_equal(4, call_tree.total_time)
|
245
|
+
assert_equal(0, call_tree.wait_time)
|
246
|
+
assert_equal(1, call_tree.self_time)
|
247
|
+
assert_equal(3, call_tree.children_time)
|
248
|
+
|
249
|
+
assert_equal(2, method.call_trees.callees.length)
|
250
|
+
call_tree = method.call_trees.callees[0]
|
251
|
+
assert_equal('String#*', call_tree.target.full_name)
|
252
|
+
assert_equal(1, call_tree.total_time)
|
253
|
+
assert_equal(0, call_tree.wait_time)
|
254
|
+
assert_equal(1, call_tree.self_time)
|
255
|
+
assert_equal(0, call_tree.children_time)
|
256
|
+
|
257
|
+
call_tree = method.call_trees.callees[1]
|
258
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
259
|
+
assert_equal(2, call_tree.total_time)
|
260
|
+
assert_equal(0, call_tree.wait_time)
|
261
|
+
assert_equal(1, call_tree.self_time)
|
262
|
+
assert_equal(1, call_tree.children_time)
|
263
|
+
|
264
|
+
# Method 8
|
265
|
+
method = methods[8]
|
266
|
+
assert_equal('String#*', method.full_name)
|
267
|
+
assert_equal(1, method.total_time)
|
268
|
+
assert_equal(0, method.wait_time)
|
269
|
+
assert_equal(1, method.self_time)
|
270
|
+
assert_equal(0, method.children_time)
|
271
|
+
|
272
|
+
assert_equal(1, method.call_trees.callers.length)
|
273
|
+
call_tree = method.call_trees.callers[0]
|
274
|
+
assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
|
275
|
+
assert_equal(1, call_tree.total_time)
|
276
|
+
assert_equal(0, call_tree.wait_time)
|
277
|
+
assert_equal(1, call_tree.self_time)
|
278
|
+
assert_equal(0, call_tree.children_time)
|
279
|
+
|
280
|
+
assert_equal(0, method.call_trees.callees.length)
|
281
|
+
|
282
|
+
# Method 9
|
283
|
+
method = methods[9]
|
284
|
+
assert_equal('String#initialize', method.full_name)
|
285
|
+
assert_equal(1, method.total_time)
|
286
|
+
assert_equal(0, method.wait_time)
|
287
|
+
assert_equal(1, method.self_time)
|
288
|
+
assert_equal(0, method.children_time)
|
289
|
+
|
290
|
+
assert_equal(1, method.call_trees.callers.length)
|
291
|
+
call_tree = method.call_trees.callers[0]
|
292
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
293
|
+
assert_equal(1, call_tree.total_time)
|
294
|
+
assert_equal(0, call_tree.wait_time)
|
295
|
+
assert_equal(1, call_tree.self_time)
|
296
|
+
assert_equal(0, call_tree.children_time)
|
297
|
+
|
298
|
+
assert_equal(0, method.call_trees.callees.length)
|
299
|
+
|
300
|
+
# Method 10
|
301
|
+
method = methods[10]
|
302
|
+
assert_equal('BasicObject#initialize', method.full_name)
|
303
|
+
assert_equal(0, method.total_time)
|
304
|
+
assert_equal(0, method.wait_time)
|
305
|
+
assert_equal(0, method.self_time)
|
306
|
+
assert_equal(0, method.children_time)
|
307
|
+
|
308
|
+
assert_equal(1, method.call_trees.callers.length)
|
309
|
+
call_tree = method.call_trees.callers[0]
|
310
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
311
|
+
assert_equal(0, call_tree.total_time)
|
312
|
+
assert_equal(0, call_tree.wait_time)
|
313
|
+
assert_equal(0, call_tree.self_time)
|
314
|
+
assert_equal(0, call_tree.children_time)
|
315
|
+
|
316
|
+
assert_equal(0, method.call_trees.callees.length)
|
317
|
+
|
318
|
+
# Method 11
|
319
|
+
method = methods[11]
|
320
|
+
assert_equal('Hash#initialize', method.full_name)
|
321
|
+
assert_equal(0, method.total_time)
|
322
|
+
assert_equal(0, method.wait_time)
|
323
|
+
assert_equal(0, method.self_time)
|
324
|
+
assert_equal(0, method.children_time)
|
325
|
+
|
326
|
+
assert_equal(1, method.call_trees.callers.length)
|
327
|
+
call_tree = method.call_trees.callers[0]
|
328
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
329
|
+
assert_equal(0, call_tree.total_time)
|
330
|
+
assert_equal(0, call_tree.wait_time)
|
331
|
+
assert_equal(0, call_tree.self_time)
|
332
|
+
assert_equal(0, call_tree.children_time)
|
333
|
+
|
334
|
+
assert_equal(0, method.call_trees.callees.length)
|
335
|
+
|
336
|
+
# Method 12
|
337
|
+
method = methods[12]
|
338
|
+
assert_equal('Array#initialize', method.full_name)
|
339
|
+
assert_equal(0, method.total_time)
|
340
|
+
assert_equal(0, method.wait_time)
|
341
|
+
assert_equal(0, method.self_time)
|
342
|
+
assert_equal(0, method.children_time)
|
343
|
+
|
344
|
+
assert_equal(1, method.call_trees.callers.length)
|
345
|
+
call_tree = method.call_trees.callers[0]
|
346
|
+
assert_equal('<Class::Array>#new', call_tree.parent.target.full_name)
|
347
|
+
assert_equal(0, call_tree.total_time)
|
348
|
+
assert_equal(0, call_tree.wait_time)
|
349
|
+
assert_equal(0, call_tree.self_time)
|
350
|
+
assert_equal(0, call_tree.children_time)
|
351
|
+
|
352
|
+
assert_equal(0, method.call_trees.callees.length)
|
353
|
+
elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.4')
|
354
|
+
assert_equal(17, methods.length)
|
355
|
+
|
356
|
+
# Method 0
|
357
|
+
method = methods[0]
|
358
|
+
assert_equal('MeasureAllocationsTest#test_allocations', method.full_name)
|
359
|
+
assert_in_delta(20, method.total_time, 1)
|
360
|
+
assert_equal(0, method.wait_time)
|
361
|
+
assert_equal(0, method.self_time)
|
362
|
+
assert_in_delta(20, method.children_time, 1)
|
363
|
+
|
364
|
+
assert_equal(0, method.call_trees.callers.length)
|
365
|
+
|
366
|
+
assert_equal(2, method.call_trees.callees.length)
|
367
|
+
call_tree = method.call_trees.callees[0]
|
368
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
369
|
+
assert_equal(1, call_tree.total_time)
|
370
|
+
assert_equal(0, call_tree.wait_time)
|
371
|
+
assert_equal(1, call_tree.self_time)
|
372
|
+
assert_equal(0, call_tree.children_time)
|
373
|
+
|
374
|
+
call_tree = method.call_trees.callees[1]
|
375
|
+
assert_equal('Allocator#run', call_tree.target.full_name)
|
376
|
+
assert_equal(19, call_tree.total_time)
|
377
|
+
assert_equal(0, call_tree.wait_time)
|
378
|
+
assert_equal(0, call_tree.self_time)
|
379
|
+
assert_equal(19, call_tree.children_time)
|
380
|
+
|
381
|
+
# Method 1
|
382
|
+
method = methods[1]
|
383
|
+
assert_equal('Allocator#run',method.full_name)
|
384
|
+
assert_equal(19, method.total_time)
|
385
|
+
assert_equal(0, method.wait_time)
|
386
|
+
assert_equal(0, method.self_time)
|
387
|
+
assert_equal(19, method.children_time)
|
388
|
+
|
389
|
+
assert_equal(1, method.call_trees.callers.length)
|
390
|
+
call_tree = method.call_trees.callers[0]
|
391
|
+
assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
|
392
|
+
assert_equal(19, call_tree.total_time)
|
393
|
+
assert_equal(0, call_tree.wait_time)
|
394
|
+
assert_equal(0, call_tree.self_time)
|
395
|
+
assert_equal(19, call_tree.children_time)
|
396
|
+
|
397
|
+
assert_equal(3, method.call_trees.callees.length)
|
398
|
+
call_tree = method.call_trees.callees[0]
|
399
|
+
assert_equal('Allocator#make_arrays', call_tree.target.full_name)
|
400
|
+
assert_equal(10, call_tree.total_time)
|
401
|
+
assert_equal(0, call_tree.wait_time)
|
402
|
+
assert_equal(0, call_tree.self_time)
|
403
|
+
assert_equal(10, call_tree.children_time)
|
404
|
+
|
405
|
+
call_tree = method.call_trees.callees[1]
|
406
|
+
assert_equal('Allocator#make_hashes', call_tree.target.full_name)
|
407
|
+
assert_equal(5, call_tree.total_time)
|
408
|
+
assert_equal(0, call_tree.wait_time)
|
409
|
+
assert_equal(0, call_tree.self_time)
|
410
|
+
assert_equal(5, call_tree.children_time)
|
411
|
+
|
412
|
+
call_tree = method.call_trees.callees[2]
|
413
|
+
assert_equal('Allocator#make_strings', call_tree.target.full_name)
|
414
|
+
assert_equal(4, call_tree.total_time)
|
415
|
+
assert_equal(0, call_tree.wait_time)
|
416
|
+
assert_equal(1, call_tree.self_time)
|
417
|
+
assert_equal(3, call_tree.children_time)
|
418
|
+
|
419
|
+
# Method 2
|
420
|
+
method = methods[2]
|
421
|
+
assert_equal('Allocator#make_arrays', method.full_name)
|
422
|
+
assert_equal(10, method.total_time)
|
423
|
+
assert_equal(0, method.wait_time)
|
424
|
+
assert_equal(0, method.self_time)
|
425
|
+
assert_equal(10, method.children_time)
|
426
|
+
|
427
|
+
assert_equal(1, method.call_trees.callers.length)
|
428
|
+
call_tree = method.call_trees.callers[0]
|
429
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
430
|
+
assert_equal(10, call_tree.total_time)
|
431
|
+
assert_equal(0, call_tree.wait_time)
|
432
|
+
assert_equal(0, call_tree.self_time)
|
433
|
+
assert_equal(10, call_tree.children_time)
|
434
|
+
|
435
|
+
assert_equal(1, method.call_trees.callees.length)
|
436
|
+
call_tree = method.call_trees.callees[0]
|
437
|
+
assert_equal('Integer#times', call_tree.target.full_name)
|
438
|
+
assert_equal(10, call_tree.total_time)
|
439
|
+
assert_equal(0, call_tree.wait_time)
|
440
|
+
assert_equal(0, call_tree.self_time)
|
441
|
+
assert_equal(10, call_tree.children_time)
|
442
|
+
|
443
|
+
# Method 3
|
444
|
+
method = methods[3]
|
445
|
+
assert_equal('Integer#times', method.full_name)
|
446
|
+
assert_equal(10, method.total_time)
|
447
|
+
assert_equal(0, method.wait_time)
|
448
|
+
assert_equal(0, method.self_time)
|
449
|
+
assert_equal(10, method.children_time)
|
450
|
+
|
451
|
+
assert_equal(1, method.call_trees.callers.length)
|
452
|
+
call_tree = method.call_trees.callers[0]
|
453
|
+
assert_equal('Allocator#make_arrays', call_tree.parent.target.full_name)
|
454
|
+
assert_equal(10, call_tree.total_time)
|
455
|
+
assert_equal(0, call_tree.wait_time)
|
456
|
+
assert_equal(0, call_tree.self_time)
|
457
|
+
assert_equal(10, call_tree.children_time)
|
458
|
+
|
459
|
+
assert_equal(4, method.call_trees.callees.length)
|
460
|
+
|
461
|
+
call_tree = method.call_trees.callees[0]
|
462
|
+
assert_equal('Kernel#block_given?', call_tree.target.full_name)
|
463
|
+
assert_equal(0, call_tree.total_time)
|
464
|
+
assert_equal(0, call_tree.wait_time)
|
465
|
+
assert_equal(0, call_tree.self_time)
|
466
|
+
assert_equal(0, call_tree.children_time)
|
467
|
+
|
468
|
+
call_tree = method.call_trees.callees[1]
|
469
|
+
assert_equal('Integer#<', call_tree.target.full_name)
|
470
|
+
assert_equal(0, call_tree.total_time)
|
471
|
+
assert_equal(0, call_tree.wait_time)
|
472
|
+
assert_equal(0, call_tree.self_time)
|
473
|
+
assert_equal(0, call_tree.children_time)
|
474
|
+
|
475
|
+
call_tree = method.call_trees.callees[2]
|
476
|
+
assert_equal('<Class::Array>#new', call_tree.target.full_name)
|
477
|
+
assert_equal(10, call_tree.total_time)
|
478
|
+
assert_equal(0, call_tree.wait_time)
|
479
|
+
assert_equal(10, call_tree.self_time)
|
480
|
+
assert_equal(0, call_tree.children_time)
|
481
|
+
|
482
|
+
call_tree = method.call_trees.callees[3]
|
483
|
+
assert_equal('Integer#succ', call_tree.target.full_name)
|
484
|
+
assert_equal(0, call_tree.total_time)
|
485
|
+
assert_equal(0, call_tree.wait_time)
|
486
|
+
assert_equal(0, call_tree.self_time)
|
487
|
+
assert_equal(0, call_tree.children_time)
|
488
|
+
|
489
|
+
# Method 4
|
490
|
+
method = methods[4]
|
491
|
+
assert_equal('<Class::Array>#new', method.full_name)
|
492
|
+
assert_equal(10, method.total_time)
|
493
|
+
assert_equal(0, method.wait_time)
|
494
|
+
assert_equal(10, method.self_time)
|
495
|
+
assert_equal(0, method.children_time)
|
496
|
+
|
497
|
+
assert_equal(1, method.call_trees.callers.length)
|
498
|
+
call_tree = method.call_trees.callers[0]
|
499
|
+
assert_equal('Integer#times', call_tree.parent.target.full_name)
|
500
|
+
assert_equal(10, call_tree.total_time)
|
501
|
+
assert_equal(0, call_tree.wait_time)
|
502
|
+
assert_equal(10, call_tree.self_time)
|
503
|
+
assert_equal(0, call_tree.children_time)
|
504
|
+
|
505
|
+
assert_equal(1, method.call_trees.callees.length)
|
506
|
+
call_tree = method.call_trees.callees[0]
|
507
|
+
assert_equal('Array#initialize', call_tree.target.full_name)
|
508
|
+
assert_equal(0, call_tree.total_time)
|
509
|
+
assert_equal(0, call_tree.wait_time)
|
510
|
+
assert_equal(0, call_tree.self_time)
|
511
|
+
assert_equal(0, call_tree.children_time)
|
512
|
+
|
513
|
+
# Method 5
|
514
|
+
method = methods[5]
|
515
|
+
assert_equal('Class#new', method.full_name)
|
516
|
+
assert_equal(6, method.total_time)
|
517
|
+
assert_equal(0, method.wait_time)
|
518
|
+
assert_equal(6, method.self_time)
|
519
|
+
assert_equal(0, method.children_time)
|
520
|
+
|
521
|
+
assert_equal(2, method.call_trees.callers.length)
|
522
|
+
call_tree = method.call_trees.callers[0]
|
523
|
+
assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
|
524
|
+
assert_equal(1, call_tree.total_time)
|
525
|
+
assert_equal(0, call_tree.wait_time)
|
526
|
+
assert_equal(1, call_tree.self_time)
|
527
|
+
assert_equal(0, call_tree.children_time)
|
528
|
+
|
529
|
+
call_tree = method.call_trees.callers[1]
|
530
|
+
assert_equal('Allocator#make_hashes', call_tree.parent.target.full_name)
|
531
|
+
assert_equal(5, call_tree.total_time)
|
532
|
+
assert_equal(0, call_tree.wait_time)
|
533
|
+
assert_equal(5, call_tree.self_time)
|
534
|
+
assert_equal(0, call_tree.children_time)
|
535
|
+
|
536
|
+
assert_equal(2, method.call_trees.callees.length)
|
537
|
+
call_tree = method.call_trees.callees[0]
|
538
|
+
assert_equal('BasicObject#initialize', call_tree.target.full_name)
|
539
|
+
assert_equal(0, call_tree.total_time)
|
540
|
+
assert_equal(0, call_tree.wait_time)
|
541
|
+
assert_equal(0, call_tree.self_time)
|
542
|
+
assert_equal(0, call_tree.children_time)
|
543
|
+
|
544
|
+
call_tree = method.call_trees.callees[1]
|
545
|
+
assert_equal('Hash#initialize', call_tree.target.full_name)
|
546
|
+
assert_equal(0, call_tree.total_time)
|
547
|
+
assert_equal(0, call_tree.wait_time)
|
548
|
+
assert_equal(0, call_tree.self_time)
|
549
|
+
assert_equal(0, call_tree.children_time)
|
550
|
+
|
551
|
+
# Method 6
|
552
|
+
method = methods[6]
|
553
|
+
assert_equal('Allocator#make_hashes', method.full_name)
|
554
|
+
assert_equal(5, method.total_time)
|
555
|
+
assert_equal(0, method.wait_time)
|
556
|
+
assert_equal(0, method.self_time)
|
557
|
+
assert_equal(5, method.children_time)
|
558
|
+
|
559
|
+
assert_equal(1, method.call_trees.callers.length)
|
560
|
+
call_tree = method.call_trees.callers[0]
|
561
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
562
|
+
assert_equal(5, call_tree.total_time)
|
563
|
+
assert_equal(0, call_tree.wait_time)
|
564
|
+
assert_equal(0, call_tree.self_time)
|
565
|
+
assert_equal(5, call_tree.children_time)
|
566
|
+
|
567
|
+
assert_equal(1, method.call_trees.callees.length)
|
568
|
+
call_tree = method.call_trees.callees[0]
|
569
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
570
|
+
assert_equal(5, call_tree.total_time)
|
571
|
+
assert_equal(0, call_tree.wait_time)
|
572
|
+
assert_equal(5, call_tree.self_time)
|
573
|
+
assert_equal(0, call_tree.children_time)
|
574
|
+
|
575
|
+
# Method 7
|
576
|
+
method = methods[7]
|
577
|
+
assert_equal('Allocator#make_strings', method.full_name)
|
578
|
+
assert_equal(4, method.total_time)
|
579
|
+
assert_equal(0, method.wait_time)
|
580
|
+
assert_equal(1, method.self_time)
|
581
|
+
assert_equal(3, method.children_time)
|
582
|
+
|
583
|
+
assert_equal(1, method.call_trees.callers.length)
|
584
|
+
call_tree = method.call_trees.callers[0]
|
585
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
586
|
+
assert_equal(4, call_tree.total_time)
|
587
|
+
assert_equal(0, call_tree.wait_time)
|
588
|
+
assert_equal(1, call_tree.self_time)
|
589
|
+
assert_equal(3, call_tree.children_time)
|
590
|
+
|
591
|
+
assert_equal(2, method.call_trees.callees.length)
|
592
|
+
call_tree = method.call_trees.callees[0]
|
593
|
+
assert_equal('String#*', call_tree.target.full_name)
|
594
|
+
assert_equal(1, call_tree.total_time)
|
595
|
+
assert_equal(0, call_tree.wait_time)
|
596
|
+
assert_equal(1, call_tree.self_time)
|
597
|
+
assert_equal(0, call_tree.children_time)
|
598
|
+
|
599
|
+
call_tree = method.call_trees.callees[1]
|
600
|
+
assert_equal('<Class::String>#new', call_tree.target.full_name)
|
601
|
+
assert_equal(2, call_tree.total_time)
|
602
|
+
assert_equal(0, call_tree.wait_time)
|
603
|
+
assert_equal(1, call_tree.self_time)
|
604
|
+
assert_equal(1, call_tree.children_time)
|
605
|
+
|
606
|
+
# Method 8
|
607
|
+
method = methods[8]
|
608
|
+
assert_equal('<Class::String>#new', method.full_name)
|
609
|
+
assert_equal(2, method.total_time)
|
610
|
+
assert_equal(0, method.wait_time)
|
611
|
+
assert_equal(1, method.self_time)
|
612
|
+
assert_equal(1, method.children_time)
|
613
|
+
|
614
|
+
assert_equal(1, method.call_trees.callers.length)
|
615
|
+
call_tree = method.call_trees.callers[0]
|
616
|
+
assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
|
617
|
+
assert_equal(2, call_tree.total_time)
|
618
|
+
assert_equal(0, call_tree.wait_time)
|
619
|
+
assert_equal(1, call_tree.self_time)
|
620
|
+
assert_equal(1, call_tree.children_time)
|
621
|
+
|
622
|
+
assert_equal(1, method.call_trees.callees.length)
|
623
|
+
|
624
|
+
call_tree = method.call_trees.callees[0]
|
625
|
+
assert_equal('String#initialize', call_tree.target.full_name)
|
626
|
+
assert_equal(1, call_tree.total_time)
|
627
|
+
assert_equal(0, call_tree.wait_time)
|
628
|
+
assert_equal(1, call_tree.self_time)
|
629
|
+
assert_equal(0, call_tree.children_time)
|
630
|
+
|
631
|
+
# Method 9
|
632
|
+
method = methods[9]
|
633
|
+
assert_equal('String#*', method.full_name)
|
634
|
+
assert_equal(1, method.total_time)
|
635
|
+
assert_equal(0, method.wait_time)
|
636
|
+
assert_equal(1, method.self_time)
|
637
|
+
assert_equal(0, method.children_time)
|
638
|
+
|
639
|
+
assert_equal(1, method.call_trees.callers.length)
|
640
|
+
call_tree = method.call_trees.callers[0]
|
641
|
+
assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
|
642
|
+
assert_equal(1, call_tree.total_time)
|
643
|
+
assert_equal(0, call_tree.wait_time)
|
644
|
+
assert_equal(1, call_tree.self_time)
|
645
|
+
assert_equal(0, call_tree.children_time)
|
646
|
+
|
647
|
+
assert_equal(0, method.call_trees.callees.length)
|
648
|
+
|
649
|
+
# Method 10
|
650
|
+
method = methods[10]
|
651
|
+
assert_equal('String#initialize', method.full_name)
|
652
|
+
assert_equal(1, method.total_time)
|
653
|
+
assert_equal(0, method.wait_time)
|
654
|
+
assert_equal(1, method.self_time)
|
655
|
+
assert_equal(0, method.children_time)
|
656
|
+
|
657
|
+
assert_equal(1, method.call_trees.callers.length)
|
658
|
+
call_tree = method.call_trees.callers[0]
|
659
|
+
assert_equal('<Class::String>#new', call_tree.parent.target.full_name)
|
660
|
+
assert_equal(1, call_tree.total_time)
|
661
|
+
assert_equal(0, call_tree.wait_time)
|
662
|
+
assert_equal(1, call_tree.self_time)
|
663
|
+
assert_equal(0, call_tree.children_time)
|
664
|
+
|
665
|
+
assert_equal(0, method.call_trees.callees.length)
|
666
|
+
|
667
|
+
# Method 11
|
668
|
+
method = methods[11]
|
669
|
+
assert_equal('BasicObject#initialize', method.full_name)
|
670
|
+
assert_equal(0, method.total_time)
|
671
|
+
assert_equal(0, method.wait_time)
|
672
|
+
assert_equal(0, method.self_time)
|
673
|
+
assert_equal(0, method.children_time)
|
674
|
+
|
675
|
+
assert_equal(1, method.call_trees.callers.length)
|
676
|
+
call_tree = method.call_trees.callers[0]
|
677
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
678
|
+
assert_equal(0, call_tree.total_time)
|
679
|
+
assert_equal(0, call_tree.wait_time)
|
680
|
+
assert_equal(0, call_tree.self_time)
|
681
|
+
assert_equal(0, call_tree.children_time)
|
682
|
+
|
683
|
+
assert_equal(0, method.call_trees.callees.length)
|
684
|
+
|
685
|
+
# Method 12
|
686
|
+
method = methods[12]
|
687
|
+
assert_equal('Kernel#block_given?', method.full_name)
|
688
|
+
assert_equal(0, method.total_time)
|
689
|
+
assert_equal(0, method.wait_time)
|
690
|
+
assert_equal(0, method.self_time)
|
691
|
+
assert_equal(0, method.children_time)
|
692
|
+
|
693
|
+
assert_equal(1, method.call_trees.callers.length)
|
694
|
+
call_tree = method.call_trees.callers[0]
|
695
|
+
assert_equal('Integer#times', call_tree.parent.target.full_name)
|
696
|
+
assert_equal(0, call_tree.total_time)
|
697
|
+
assert_equal(0, call_tree.wait_time)
|
698
|
+
assert_equal(0, call_tree.self_time)
|
699
|
+
assert_equal(0, call_tree.children_time)
|
700
|
+
|
701
|
+
assert_equal(0, method.call_trees.callees.length)
|
702
|
+
|
703
|
+
# Method 13
|
704
|
+
method = methods[13]
|
705
|
+
assert_equal('Integer#succ', method.full_name)
|
706
|
+
assert_equal(0, method.total_time)
|
707
|
+
assert_equal(0, method.wait_time)
|
708
|
+
assert_equal(0, method.self_time)
|
709
|
+
assert_equal(0, method.children_time)
|
710
|
+
|
711
|
+
assert_equal(1, method.call_trees.callers.length)
|
712
|
+
call_tree = method.call_trees.callers[0]
|
713
|
+
assert_equal('Integer#times', call_tree.parent.target.full_name)
|
714
|
+
assert_equal(0, call_tree.total_time)
|
715
|
+
assert_equal(0, call_tree.wait_time)
|
716
|
+
assert_equal(0, call_tree.self_time)
|
717
|
+
assert_equal(0, call_tree.children_time)
|
718
|
+
|
719
|
+
assert_equal(0, method.call_trees.callees.length)
|
720
|
+
|
721
|
+
# Method 14
|
722
|
+
method = methods[14]
|
723
|
+
assert_equal('Integer#<', method.full_name)
|
724
|
+
assert_equal(0, method.total_time)
|
725
|
+
assert_equal(0, method.wait_time)
|
726
|
+
assert_equal(0, method.self_time)
|
727
|
+
assert_equal(0, method.children_time)
|
728
|
+
|
729
|
+
assert_equal(1, method.call_trees.callers.length)
|
730
|
+
call_tree = method.call_trees.callers[0]
|
731
|
+
assert_equal('Integer#times', call_tree.parent.target.full_name)
|
732
|
+
assert_equal(0, call_tree.total_time)
|
733
|
+
assert_equal(0, call_tree.wait_time)
|
734
|
+
assert_equal(0, call_tree.self_time)
|
735
|
+
assert_equal(0, call_tree.children_time)
|
736
|
+
|
737
|
+
assert_equal(0, method.call_trees.callees.length)
|
738
|
+
|
739
|
+
# Method 15
|
740
|
+
method = methods[15]
|
741
|
+
assert_equal('Hash#initialize', method.full_name)
|
742
|
+
assert_equal(0, method.total_time)
|
743
|
+
assert_equal(0, method.wait_time)
|
744
|
+
assert_equal(0, method.self_time)
|
745
|
+
assert_equal(0, method.children_time)
|
746
|
+
|
747
|
+
assert_equal(1, method.call_trees.callers.length)
|
748
|
+
call_tree = method.call_trees.callers[0]
|
749
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
750
|
+
assert_equal(0, call_tree.total_time)
|
751
|
+
assert_equal(0, call_tree.wait_time)
|
752
|
+
assert_equal(0, call_tree.self_time)
|
753
|
+
assert_equal(0, call_tree.children_time)
|
754
|
+
|
755
|
+
assert_equal(0, method.call_trees.callees.length)
|
756
|
+
|
757
|
+
# Method 16
|
758
|
+
method = methods[16]
|
759
|
+
assert_equal('Array#initialize', method.full_name)
|
760
|
+
assert_equal(0, method.total_time)
|
761
|
+
assert_equal(0, method.wait_time)
|
762
|
+
assert_equal(0, method.self_time)
|
763
|
+
assert_equal(0, method.children_time)
|
764
|
+
|
765
|
+
assert_equal(1, method.call_trees.callers.length)
|
766
|
+
call_tree = method.call_trees.callers[0]
|
767
|
+
assert_equal('<Class::Array>#new', call_tree.parent.target.full_name)
|
768
|
+
assert_equal(0, call_tree.total_time)
|
769
|
+
assert_equal(0, call_tree.wait_time)
|
770
|
+
assert_equal(0, call_tree.self_time)
|
771
|
+
assert_equal(0, call_tree.children_time)
|
772
|
+
|
773
|
+
assert_equal(0, method.call_trees.callees.length)
|
774
|
+
else
|
775
|
+
assert_equal(16, methods.length)
|
776
|
+
|
777
|
+
# Method 0
|
778
|
+
method = methods[0]
|
779
|
+
assert_equal('MeasureAllocationsTest#test_allocations', method.full_name)
|
780
|
+
assert_in_delta(20, method.total_time, 1)
|
781
|
+
assert_equal(0, method.wait_time)
|
782
|
+
assert_equal(0, method.self_time)
|
783
|
+
assert_in_delta(20, method.children_time, 1)
|
784
|
+
|
785
|
+
assert_equal(0, method.call_trees.callers.length)
|
786
|
+
|
787
|
+
assert_equal(2, method.call_trees.callees.length)
|
788
|
+
call_tree = method.call_trees.callees[0]
|
789
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
790
|
+
assert_equal(1, call_tree.total_time)
|
791
|
+
assert_equal(0, call_tree.wait_time)
|
792
|
+
assert_equal(1, call_tree.self_time)
|
793
|
+
assert_equal(0, call_tree.children_time)
|
794
|
+
|
795
|
+
call_tree = method.call_trees.callees[1]
|
796
|
+
assert_equal('Allocator#run', call_tree.target.full_name)
|
797
|
+
assert_equal(19, call_tree.total_time)
|
798
|
+
assert_equal(0, call_tree.wait_time)
|
799
|
+
assert_equal(0, call_tree.self_time)
|
800
|
+
assert_equal(19, call_tree.children_time)
|
801
|
+
|
802
|
+
# Method 1
|
803
|
+
method = methods[1]
|
804
|
+
assert_equal('Allocator#run',method.full_name)
|
805
|
+
assert_equal(19, method.total_time)
|
806
|
+
assert_equal(0, method.wait_time)
|
807
|
+
assert_equal(0, method.self_time)
|
808
|
+
assert_equal(19, method.children_time)
|
809
|
+
|
810
|
+
assert_equal(1, method.call_trees.callers.length)
|
811
|
+
call_tree = method.call_trees.callers[0]
|
812
|
+
assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
|
813
|
+
assert_equal(19, call_tree.total_time)
|
814
|
+
assert_equal(0, call_tree.wait_time)
|
815
|
+
assert_equal(0, call_tree.self_time)
|
816
|
+
assert_equal(19, call_tree.children_time)
|
817
|
+
|
818
|
+
assert_equal(3, method.call_trees.callees.length)
|
819
|
+
call_tree = method.call_trees.callees[0]
|
820
|
+
assert_equal('Allocator#make_arrays', call_tree.target.full_name)
|
821
|
+
assert_equal(10, call_tree.total_time)
|
822
|
+
assert_equal(0, call_tree.wait_time)
|
823
|
+
assert_equal(0, call_tree.self_time)
|
824
|
+
assert_equal(10, call_tree.children_time)
|
825
|
+
|
826
|
+
call_tree = method.call_trees.callees[1]
|
827
|
+
assert_equal('Allocator#make_hashes', call_tree.target.full_name)
|
828
|
+
assert_equal(5, call_tree.total_time)
|
829
|
+
assert_equal(0, call_tree.wait_time)
|
830
|
+
assert_equal(0, call_tree.self_time)
|
831
|
+
assert_equal(5, call_tree.children_time)
|
832
|
+
|
833
|
+
call_tree = method.call_trees.callees[2]
|
834
|
+
assert_equal('Allocator#make_strings', call_tree.target.full_name)
|
835
|
+
assert_equal(4, call_tree.total_time)
|
836
|
+
assert_equal(0, call_tree.wait_time)
|
837
|
+
assert_equal(1, call_tree.self_time)
|
838
|
+
assert_equal(3, call_tree.children_time)
|
839
|
+
|
840
|
+
# Method 2
|
841
|
+
method = methods[2]
|
842
|
+
assert_equal('Allocator#make_arrays', method.full_name)
|
843
|
+
assert_equal(10, method.total_time)
|
844
|
+
assert_equal(0, method.wait_time)
|
845
|
+
assert_equal(0, method.self_time)
|
846
|
+
assert_equal(10, method.children_time)
|
847
|
+
|
848
|
+
assert_equal(1, method.call_trees.callers.length)
|
849
|
+
call_tree = method.call_trees.callers[0]
|
850
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
851
|
+
assert_equal(10, call_tree.total_time)
|
852
|
+
assert_equal(0, call_tree.wait_time)
|
853
|
+
assert_equal(0, call_tree.self_time)
|
854
|
+
assert_equal(10, call_tree.children_time)
|
855
|
+
|
856
|
+
assert_equal(1, method.call_trees.callees.length)
|
857
|
+
call_tree = method.call_trees.callees[0]
|
858
|
+
assert_equal('Integer#times', call_tree.target.full_name)
|
859
|
+
assert_equal(10, call_tree.total_time)
|
860
|
+
assert_equal(0, call_tree.wait_time)
|
861
|
+
assert_equal(0, call_tree.self_time)
|
862
|
+
assert_equal(10, call_tree.children_time)
|
863
|
+
|
864
|
+
# Method 3
|
865
|
+
method = methods[3]
|
866
|
+
assert_equal('Integer#times', method.full_name)
|
867
|
+
assert_equal(10, method.total_time)
|
868
|
+
assert_equal(0, method.wait_time)
|
869
|
+
assert_equal(0, method.self_time)
|
870
|
+
assert_equal(10, method.children_time)
|
871
|
+
|
872
|
+
assert_equal(1, method.call_trees.callers.length)
|
873
|
+
call_tree = method.call_trees.callers[0]
|
874
|
+
assert_equal('Allocator#make_arrays', call_tree.parent.target.full_name)
|
875
|
+
assert_equal(10, call_tree.total_time)
|
876
|
+
assert_equal(0, call_tree.wait_time)
|
877
|
+
assert_equal(0, call_tree.self_time)
|
878
|
+
assert_equal(10, call_tree.children_time)
|
879
|
+
|
880
|
+
assert_equal(3, method.call_trees.callees.length)
|
881
|
+
|
882
|
+
call_tree = method.call_trees.callees[0]
|
883
|
+
assert_equal('Integer#<', call_tree.target.full_name)
|
884
|
+
assert_equal(0, call_tree.total_time)
|
885
|
+
assert_equal(0, call_tree.wait_time)
|
886
|
+
assert_equal(0, call_tree.self_time)
|
887
|
+
assert_equal(0, call_tree.children_time)
|
888
|
+
|
889
|
+
call_tree = method.call_trees.callees[1]
|
890
|
+
assert_equal('<Class::Array>#new', call_tree.target.full_name)
|
891
|
+
assert_equal(10, call_tree.total_time)
|
892
|
+
assert_equal(0, call_tree.wait_time)
|
893
|
+
assert_equal(10, call_tree.self_time)
|
894
|
+
assert_equal(0, call_tree.children_time)
|
895
|
+
|
896
|
+
call_tree = method.call_trees.callees[2]
|
897
|
+
assert_equal('Integer#succ', call_tree.target.full_name)
|
898
|
+
assert_equal(0, call_tree.total_time)
|
899
|
+
assert_equal(0, call_tree.wait_time)
|
900
|
+
assert_equal(0, call_tree.self_time)
|
901
|
+
assert_equal(0, call_tree.children_time)
|
902
|
+
|
903
|
+
# Method 4
|
904
|
+
method = methods[4]
|
905
|
+
assert_equal('<Class::Array>#new', method.full_name)
|
906
|
+
assert_equal(10, method.total_time)
|
907
|
+
assert_equal(0, method.wait_time)
|
908
|
+
assert_equal(10, method.self_time)
|
909
|
+
assert_equal(0, method.children_time)
|
910
|
+
|
911
|
+
assert_equal(1, method.call_trees.callers.length)
|
912
|
+
call_tree = method.call_trees.callers[0]
|
913
|
+
assert_equal('Integer#times', call_tree.parent.target.full_name)
|
914
|
+
assert_equal(10, call_tree.total_time)
|
915
|
+
assert_equal(0, call_tree.wait_time)
|
916
|
+
assert_equal(10, call_tree.self_time)
|
917
|
+
assert_equal(0, call_tree.children_time)
|
918
|
+
|
919
|
+
assert_equal(1, method.call_trees.callees.length)
|
920
|
+
call_tree = method.call_trees.callees[0]
|
921
|
+
assert_equal('Array#initialize', call_tree.target.full_name)
|
922
|
+
assert_equal(0, call_tree.total_time)
|
923
|
+
assert_equal(0, call_tree.wait_time)
|
924
|
+
assert_equal(0, call_tree.self_time)
|
925
|
+
assert_equal(0, call_tree.children_time)
|
926
|
+
|
927
|
+
# Method 5
|
928
|
+
method = methods[5]
|
929
|
+
assert_equal('Class#new', method.full_name)
|
930
|
+
assert_equal(6, method.total_time)
|
931
|
+
assert_equal(0, method.wait_time)
|
932
|
+
assert_equal(6, method.self_time)
|
933
|
+
assert_equal(0, method.children_time)
|
934
|
+
|
935
|
+
assert_equal(2, method.call_trees.callers.length)
|
936
|
+
call_tree = method.call_trees.callers[0]
|
937
|
+
assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
|
938
|
+
assert_equal(1, call_tree.total_time)
|
939
|
+
assert_equal(0, call_tree.wait_time)
|
940
|
+
assert_equal(1, call_tree.self_time)
|
941
|
+
assert_equal(0, call_tree.children_time)
|
942
|
+
|
943
|
+
call_tree = method.call_trees.callers[1]
|
944
|
+
assert_equal('Allocator#make_hashes', call_tree.parent.target.full_name)
|
945
|
+
assert_equal(5, call_tree.total_time)
|
946
|
+
assert_equal(0, call_tree.wait_time)
|
947
|
+
assert_equal(5, call_tree.self_time)
|
948
|
+
assert_equal(0, call_tree.children_time)
|
949
|
+
|
950
|
+
assert_equal(2, method.call_trees.callees.length)
|
951
|
+
call_tree = method.call_trees.callees[0]
|
952
|
+
assert_equal('BasicObject#initialize', call_tree.target.full_name)
|
953
|
+
assert_equal(0, call_tree.total_time)
|
954
|
+
assert_equal(0, call_tree.wait_time)
|
955
|
+
assert_equal(0, call_tree.self_time)
|
956
|
+
assert_equal(0, call_tree.children_time)
|
957
|
+
|
958
|
+
call_tree = method.call_trees.callees[1]
|
959
|
+
assert_equal('Hash#initialize', call_tree.target.full_name)
|
960
|
+
assert_equal(0, call_tree.total_time)
|
961
|
+
assert_equal(0, call_tree.wait_time)
|
962
|
+
assert_equal(0, call_tree.self_time)
|
963
|
+
assert_equal(0, call_tree.children_time)
|
964
|
+
|
965
|
+
# Method 6
|
966
|
+
method = methods[6]
|
967
|
+
assert_equal('Allocator#make_hashes', method.full_name)
|
968
|
+
assert_equal(5, method.total_time)
|
969
|
+
assert_equal(0, method.wait_time)
|
970
|
+
assert_equal(0, method.self_time)
|
971
|
+
assert_equal(5, method.children_time)
|
972
|
+
|
973
|
+
assert_equal(1, method.call_trees.callers.length)
|
974
|
+
call_tree = method.call_trees.callers[0]
|
975
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
976
|
+
assert_equal(5, call_tree.total_time)
|
977
|
+
assert_equal(0, call_tree.wait_time)
|
978
|
+
assert_equal(0, call_tree.self_time)
|
979
|
+
assert_equal(5, call_tree.children_time)
|
980
|
+
|
981
|
+
assert_equal(1, method.call_trees.callees.length)
|
982
|
+
call_tree = method.call_trees.callees[0]
|
983
|
+
assert_equal('Class#new', call_tree.target.full_name)
|
984
|
+
assert_equal(5, call_tree.total_time)
|
985
|
+
assert_equal(0, call_tree.wait_time)
|
986
|
+
assert_equal(5, call_tree.self_time)
|
987
|
+
assert_equal(0, call_tree.children_time)
|
988
|
+
|
989
|
+
# Method 7
|
990
|
+
method = methods[7]
|
991
|
+
assert_equal('Allocator#make_strings', method.full_name)
|
992
|
+
assert_equal(4, method.total_time)
|
993
|
+
assert_equal(0, method.wait_time)
|
994
|
+
assert_equal(1, method.self_time)
|
995
|
+
assert_equal(3, method.children_time)
|
996
|
+
|
997
|
+
assert_equal(1, method.call_trees.callers.length)
|
998
|
+
call_tree = method.call_trees.callers[0]
|
999
|
+
assert_equal('Allocator#run', call_tree.parent.target.full_name)
|
1000
|
+
assert_equal(4, call_tree.total_time)
|
1001
|
+
assert_equal(0, call_tree.wait_time)
|
1002
|
+
assert_equal(1, call_tree.self_time)
|
1003
|
+
assert_equal(3, call_tree.children_time)
|
1004
|
+
|
1005
|
+
assert_equal(2, method.call_trees.callees.length)
|
1006
|
+
call_tree = method.call_trees.callees[0]
|
1007
|
+
assert_equal('String#*', call_tree.target.full_name)
|
1008
|
+
assert_equal(1, call_tree.total_time)
|
1009
|
+
assert_equal(0, call_tree.wait_time)
|
1010
|
+
assert_equal(1, call_tree.self_time)
|
1011
|
+
assert_equal(0, call_tree.children_time)
|
1012
|
+
|
1013
|
+
call_tree = method.call_trees.callees[1]
|
1014
|
+
assert_equal('<Class::String>#new', call_tree.target.full_name)
|
1015
|
+
assert_equal(2, call_tree.total_time)
|
1016
|
+
assert_equal(0, call_tree.wait_time)
|
1017
|
+
assert_equal(1, call_tree.self_time)
|
1018
|
+
assert_equal(1, call_tree.children_time)
|
1019
|
+
|
1020
|
+
# Method 8
|
1021
|
+
method = methods[8]
|
1022
|
+
assert_equal('<Class::String>#new', method.full_name)
|
1023
|
+
assert_equal(2, method.total_time)
|
1024
|
+
assert_equal(0, method.wait_time)
|
1025
|
+
assert_equal(1, method.self_time)
|
1026
|
+
assert_equal(1, method.children_time)
|
1027
|
+
|
1028
|
+
assert_equal(1, method.call_trees.callers.length)
|
1029
|
+
call_tree = method.call_trees.callers[0]
|
1030
|
+
assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
|
1031
|
+
assert_equal(2, call_tree.total_time)
|
1032
|
+
assert_equal(0, call_tree.wait_time)
|
1033
|
+
assert_equal(1, call_tree.self_time)
|
1034
|
+
assert_equal(1, call_tree.children_time)
|
1035
|
+
|
1036
|
+
assert_equal(1, method.call_trees.callees.length)
|
1037
|
+
|
1038
|
+
call_tree = method.call_trees.callees[0]
|
1039
|
+
assert_equal('String#initialize', call_tree.target.full_name)
|
1040
|
+
assert_equal(1, call_tree.total_time)
|
1041
|
+
assert_equal(0, call_tree.wait_time)
|
1042
|
+
assert_equal(1, call_tree.self_time)
|
1043
|
+
assert_equal(0, call_tree.children_time)
|
1044
|
+
|
1045
|
+
# Method 9
|
1046
|
+
method = methods[9]
|
1047
|
+
assert_equal('String#*', method.full_name)
|
1048
|
+
assert_equal(1, method.total_time)
|
1049
|
+
assert_equal(0, method.wait_time)
|
1050
|
+
assert_equal(1, method.self_time)
|
1051
|
+
assert_equal(0, method.children_time)
|
1052
|
+
|
1053
|
+
assert_equal(1, method.call_trees.callers.length)
|
1054
|
+
call_tree = method.call_trees.callers[0]
|
1055
|
+
assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
|
1056
|
+
assert_equal(1, call_tree.total_time)
|
1057
|
+
assert_equal(0, call_tree.wait_time)
|
1058
|
+
assert_equal(1, call_tree.self_time)
|
1059
|
+
assert_equal(0, call_tree.children_time)
|
1060
|
+
|
1061
|
+
assert_equal(0, method.call_trees.callees.length)
|
1062
|
+
|
1063
|
+
# Method 10
|
1064
|
+
method = methods[10]
|
1065
|
+
assert_equal('String#initialize', method.full_name)
|
1066
|
+
assert_equal(1, method.total_time)
|
1067
|
+
assert_equal(0, method.wait_time)
|
1068
|
+
assert_equal(1, method.self_time)
|
1069
|
+
assert_equal(0, method.children_time)
|
1070
|
+
|
1071
|
+
assert_equal(1, method.call_trees.callers.length)
|
1072
|
+
call_tree = method.call_trees.callers[0]
|
1073
|
+
assert_equal('<Class::String>#new', call_tree.parent.target.full_name)
|
1074
|
+
assert_equal(1, call_tree.total_time)
|
1075
|
+
assert_equal(0, call_tree.wait_time)
|
1076
|
+
assert_equal(1, call_tree.self_time)
|
1077
|
+
assert_equal(0, call_tree.children_time)
|
1078
|
+
|
1079
|
+
assert_equal(0, method.call_trees.callees.length)
|
1080
|
+
|
1081
|
+
# Method 11
|
1082
|
+
method = methods[11]
|
1083
|
+
assert_equal('BasicObject#initialize', method.full_name)
|
1084
|
+
assert_equal(0, method.total_time)
|
1085
|
+
assert_equal(0, method.wait_time)
|
1086
|
+
assert_equal(0, method.self_time)
|
1087
|
+
assert_equal(0, method.children_time)
|
1088
|
+
|
1089
|
+
assert_equal(1, method.call_trees.callers.length)
|
1090
|
+
call_tree = method.call_trees.callers[0]
|
1091
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
1092
|
+
assert_equal(0, call_tree.total_time)
|
1093
|
+
assert_equal(0, call_tree.wait_time)
|
1094
|
+
assert_equal(0, call_tree.self_time)
|
1095
|
+
assert_equal(0, call_tree.children_time)
|
1096
|
+
|
1097
|
+
assert_equal(0, method.call_trees.callees.length)
|
1098
|
+
|
1099
|
+
# Method 12
|
1100
|
+
method = methods[12]
|
1101
|
+
assert_equal('Integer#succ', method.full_name)
|
1102
|
+
assert_equal(0, method.total_time)
|
1103
|
+
assert_equal(0, method.wait_time)
|
1104
|
+
assert_equal(0, method.self_time)
|
1105
|
+
assert_equal(0, method.children_time)
|
1106
|
+
|
1107
|
+
assert_equal(1, method.call_trees.callers.length)
|
1108
|
+
call_tree = method.call_trees.callers[0]
|
1109
|
+
assert_equal('Integer#times', call_tree.parent.target.full_name)
|
1110
|
+
assert_equal(0, call_tree.total_time)
|
1111
|
+
assert_equal(0, call_tree.wait_time)
|
1112
|
+
assert_equal(0, call_tree.self_time)
|
1113
|
+
assert_equal(0, call_tree.children_time)
|
1114
|
+
|
1115
|
+
assert_equal(0, method.call_trees.callees.length)
|
1116
|
+
|
1117
|
+
# Method 13
|
1118
|
+
method = methods[13]
|
1119
|
+
assert_equal('Integer#<', method.full_name)
|
1120
|
+
assert_equal(0, method.total_time)
|
1121
|
+
assert_equal(0, method.wait_time)
|
1122
|
+
assert_equal(0, method.self_time)
|
1123
|
+
assert_equal(0, method.children_time)
|
1124
|
+
|
1125
|
+
assert_equal(1, method.call_trees.callers.length)
|
1126
|
+
call_tree = method.call_trees.callers[0]
|
1127
|
+
assert_equal('Integer#times', call_tree.parent.target.full_name)
|
1128
|
+
assert_equal(0, call_tree.total_time)
|
1129
|
+
assert_equal(0, call_tree.wait_time)
|
1130
|
+
assert_equal(0, call_tree.self_time)
|
1131
|
+
assert_equal(0, call_tree.children_time)
|
1132
|
+
|
1133
|
+
assert_equal(0, method.call_trees.callees.length)
|
1134
|
+
|
1135
|
+
# Method 14
|
1136
|
+
method = methods[14]
|
1137
|
+
assert_equal('Hash#initialize', method.full_name)
|
1138
|
+
assert_equal(0, method.total_time)
|
1139
|
+
assert_equal(0, method.wait_time)
|
1140
|
+
assert_equal(0, method.self_time)
|
1141
|
+
assert_equal(0, method.children_time)
|
1142
|
+
|
1143
|
+
assert_equal(1, method.call_trees.callers.length)
|
1144
|
+
call_tree = method.call_trees.callers[0]
|
1145
|
+
assert_equal('Class#new', call_tree.parent.target.full_name)
|
1146
|
+
assert_equal(0, call_tree.total_time)
|
1147
|
+
assert_equal(0, call_tree.wait_time)
|
1148
|
+
assert_equal(0, call_tree.self_time)
|
1149
|
+
assert_equal(0, call_tree.children_time)
|
1150
|
+
|
1151
|
+
assert_equal(0, method.call_trees.callees.length)
|
1152
|
+
|
1153
|
+
# Method 15
|
1154
|
+
method = methods[15]
|
1155
|
+
assert_equal('Array#initialize', method.full_name)
|
1156
|
+
assert_equal(0, method.total_time)
|
1157
|
+
assert_equal(0, method.wait_time)
|
1158
|
+
assert_equal(0, method.self_time)
|
1159
|
+
assert_equal(0, method.children_time)
|
1160
|
+
|
1161
|
+
assert_equal(1, method.call_trees.callers.length)
|
1162
|
+
call_tree = method.call_trees.callers[0]
|
1163
|
+
assert_equal('<Class::Array>#new', call_tree.parent.target.full_name)
|
1164
|
+
assert_equal(0, call_tree.total_time)
|
1165
|
+
assert_equal(0, call_tree.wait_time)
|
1166
|
+
assert_equal(0, call_tree.self_time)
|
1167
|
+
assert_equal(0, call_tree.children_time)
|
1168
|
+
|
1169
|
+
assert_equal(0, method.call_trees.callees.length)
|
1170
|
+
end
|
1171
|
+
end
|
1172
|
+
end
|