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