ruby-prof 1.4.4-x64-mingw-ucrt → 1.4.5-x64-mingw-ucrt

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