rdp-ruby-prof 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/CHANGES +202 -0
  2. data/LICENSE +23 -0
  3. data/README +445 -0
  4. data/Rakefile +123 -0
  5. data/bin/ruby-prof +207 -0
  6. data/examples/flat.txt +55 -0
  7. data/examples/graph.html +823 -0
  8. data/examples/graph.txt +170 -0
  9. data/ext/#ruby_prof.c# +1679 -0
  10. data/ext/Makefile +180 -0
  11. data/ext/extconf.rb +40 -0
  12. data/ext/measure_allocations.h +58 -0
  13. data/ext/measure_cpu_time.h +152 -0
  14. data/ext/measure_gc_runs.h +76 -0
  15. data/ext/measure_gc_time.h +57 -0
  16. data/ext/measure_memory.h +101 -0
  17. data/ext/measure_process_time.h +52 -0
  18. data/ext/measure_wall_time.h +53 -0
  19. data/ext/mingw/Rakefile +23 -0
  20. data/ext/mingw/build.rake +38 -0
  21. data/ext/ruby_prof.c +1707 -0
  22. data/ext/ruby_prof.e +19984 -0
  23. data/ext/ruby_prof.h +188 -0
  24. data/ext/vc/ruby_prof.sln +20 -0
  25. data/ext/vc/ruby_prof.vcproj +241 -0
  26. data/ext/version.h +4 -0
  27. data/lib/ruby-prof.rb +48 -0
  28. data/lib/ruby-prof/abstract_printer.rb +41 -0
  29. data/lib/ruby-prof/aggregate_call_info.rb +62 -0
  30. data/lib/ruby-prof/call_info.rb +47 -0
  31. data/lib/ruby-prof/call_tree_printer.rb +84 -0
  32. data/lib/ruby-prof/flat_printer.rb +79 -0
  33. data/lib/ruby-prof/graph_html_printer.rb +256 -0
  34. data/lib/ruby-prof/graph_html_printer.rb.orig +256 -0
  35. data/lib/ruby-prof/graph_html_printer.rb.rej +34 -0
  36. data/lib/ruby-prof/graph_printer.rb +164 -0
  37. data/lib/ruby-prof/graph_printer.rb.orig +164 -0
  38. data/lib/ruby-prof/method_info.rb +111 -0
  39. data/lib/ruby-prof/task.rb +146 -0
  40. data/lib/ruby-prof/test.rb +148 -0
  41. data/lib/unprof.rb +8 -0
  42. data/rails/environment/profile.rb +24 -0
  43. data/rails/example/example_test.rb +9 -0
  44. data/rails/profile_test_helper.rb +21 -0
  45. data/test/aggregate_test.rb +121 -0
  46. data/test/basic_test.rb +283 -0
  47. data/test/duplicate_names_test.rb +32 -0
  48. data/test/exceptions_test.rb +15 -0
  49. data/test/exclude_threads_test.rb +54 -0
  50. data/test/line_number_test.rb +73 -0
  51. data/test/measurement_test.rb +121 -0
  52. data/test/module_test.rb +54 -0
  53. data/test/no_method_class_test.rb +13 -0
  54. data/test/prime.rb +58 -0
  55. data/test/prime_test.rb +13 -0
  56. data/test/printers_test.rb +71 -0
  57. data/test/recursive_test.rb +254 -0
  58. data/test/singleton_test.rb +37 -0
  59. data/test/stack_test.rb +138 -0
  60. data/test/start_stop_test.rb +95 -0
  61. data/test/test_suite.rb +23 -0
  62. data/test/thread_test.rb +159 -0
  63. data/test/unique_call_path_test.rb +206 -0
  64. metadata +124 -0
@@ -0,0 +1,254 @@
1
+ #!/usr/bin/env ruby
2
+ require 'test/unit'
3
+ require 'ruby-prof'
4
+
5
+ def simple(n)
6
+ sleep(1)
7
+ n -= 1
8
+ return if n == 0
9
+ simple(n)
10
+ end
11
+
12
+ def cycle(n)
13
+ sub_cycle(n)
14
+ end
15
+
16
+ def sub_cycle(n)
17
+ sleep(1)
18
+ n -= 1
19
+ return if n == 0
20
+ cycle(n)
21
+ end
22
+
23
+
24
+ # -- Tests ----
25
+ class RecursiveTest < Test::Unit::TestCase
26
+ def setup
27
+ # Need to use wall time for this test due to the sleep calls
28
+ RubyProf::measure_mode = RubyProf::WALL_TIME
29
+ end
30
+
31
+ def test_simple
32
+ result = RubyProf.profile do
33
+ simple(2)
34
+ end
35
+
36
+ methods = result.threads.values.first.sort.reverse
37
+ assert_equal(6, methods.length)
38
+
39
+ method = methods[0]
40
+ assert_equal('RecursiveTest#test_simple', method.full_name)
41
+ assert_equal(1, method.called)
42
+ assert_in_delta(2, method.total_time, 0.01)
43
+ assert_in_delta(0, method.self_time, 0.01)
44
+ assert_in_delta(0, method.wait_time, 0.01)
45
+ assert_in_delta(2, method.children_time, 0.01)
46
+
47
+ assert_equal(1, method.call_infos.length)
48
+ call_info = method.call_infos[0]
49
+ assert_equal('RecursiveTest#test_simple', call_info.call_sequence)
50
+ assert_equal(1, call_info.children.length)
51
+
52
+ method = methods[1]
53
+ assert_equal('Object#simple', method.full_name)
54
+ assert_equal(1, method.called)
55
+ assert_in_delta(2, method.total_time, 0.01)
56
+ assert_in_delta(0, method.self_time, 0.01)
57
+ assert_in_delta(0, method.wait_time, 0.01)
58
+ assert_in_delta(2, method.children_time, 0.01)
59
+
60
+ assert_equal(1, method.call_infos.length)
61
+ call_info = method.call_infos[0]
62
+ assert_equal('RecursiveTest#test_simple->Object#simple', call_info.call_sequence)
63
+ assert_equal(4, call_info.children.length)
64
+
65
+ method = methods[2]
66
+ assert_equal('Kernel#sleep', method.full_name)
67
+ assert_equal(2, method.called)
68
+ assert_in_delta(2, method.total_time, 0.01)
69
+ assert_in_delta(2, method.self_time, 0.01)
70
+ assert_in_delta(0, method.wait_time, 0.01)
71
+ assert_in_delta(0, method.children_time, 0.01)
72
+
73
+ assert_equal(2, method.call_infos.length)
74
+ call_info = method.call_infos[0]
75
+ assert_equal('RecursiveTest#test_simple->Object#simple->Kernel#sleep', call_info.call_sequence)
76
+ assert_equal(0, call_info.children.length)
77
+
78
+ call_info = method.call_infos[1]
79
+ assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple-1->Kernel#sleep', call_info.call_sequence)
80
+ assert_equal(0, call_info.children.length)
81
+
82
+ method = methods[3]
83
+ assert_equal('Object#simple-1', method.full_name)
84
+ assert_equal(1, method.called)
85
+ assert_in_delta(1, method.total_time, 0.01)
86
+ assert_in_delta(0, method.self_time, 0.01)
87
+ assert_in_delta(0, method.wait_time, 0.01)
88
+ assert_in_delta(1, method.children_time, 0.01)
89
+
90
+ assert_equal(1, method.call_infos.length)
91
+ call_info = method.call_infos[0]
92
+ assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple-1', call_info.call_sequence)
93
+ assert_equal(3, call_info.children.length)
94
+
95
+ method = methods[4]
96
+ assert_equal('Fixnum#-', method.full_name)
97
+ assert_equal(2, method.called)
98
+ assert_in_delta(0, method.total_time, 0.01)
99
+ assert_in_delta(0, method.self_time, 0.01)
100
+ assert_in_delta(0, method.wait_time, 0.01)
101
+ assert_in_delta(0, method.children_time, 0.01)
102
+
103
+ assert_equal(2, method.call_infos.length)
104
+ call_info = method.call_infos[0]
105
+ assert_equal('RecursiveTest#test_simple->Object#simple->Fixnum#-', call_info.call_sequence)
106
+ assert_equal(0, call_info.children.length)
107
+
108
+ call_info = method.call_infos[1]
109
+ assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple-1->Fixnum#-', call_info.call_sequence)
110
+ assert_equal(0, call_info.children.length)
111
+
112
+ method = methods[5]
113
+ assert_equal('Fixnum#==', method.full_name)
114
+ assert_equal(2, method.called)
115
+ assert_in_delta(0, method.total_time, 0.01)
116
+ assert_in_delta(0, method.self_time, 0.01)
117
+ assert_in_delta(0, method.wait_time, 0.01)
118
+ assert_in_delta(0, method.children_time, 0.01)
119
+
120
+ assert_equal(2, method.call_infos.length)
121
+ call_info = method.call_infos[0]
122
+ assert_equal('RecursiveTest#test_simple->Object#simple->Fixnum#==', call_info.call_sequence)
123
+ assert_equal(0, call_info.children.length)
124
+
125
+ call_info = method.call_infos[1]
126
+ assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple-1->Fixnum#==', call_info.call_sequence)
127
+ assert_equal(0, call_info.children.length)
128
+ end
129
+
130
+ def test_cycle
131
+ result = RubyProf.profile do
132
+ cycle(2)
133
+ end
134
+
135
+ methods = result.threads.values.first.sort.reverse
136
+ assert_equal(8, methods.length)
137
+
138
+ method = methods[0]
139
+ assert_equal('RecursiveTest#test_cycle', method.full_name)
140
+ assert_equal(1, method.called)
141
+ assert_in_delta(2, method.total_time, 0.01)
142
+ assert_in_delta(0, method.self_time, 0.01)
143
+ assert_in_delta(0, method.wait_time, 0.01)
144
+ assert_in_delta(2, method.children_time, 0.01)
145
+
146
+ assert_equal(1, method.call_infos.length)
147
+ call_info = method.call_infos[0]
148
+ assert_equal('RecursiveTest#test_cycle', call_info.call_sequence)
149
+ assert_equal(1, call_info.children.length)
150
+
151
+ method = methods[1]
152
+ assert_equal('Object#cycle', method.full_name)
153
+ assert_equal(1, method.called)
154
+ assert_in_delta(2, method.total_time, 0.01)
155
+ assert_in_delta(0, method.self_time, 0.01)
156
+ assert_in_delta(0, method.wait_time, 0.01)
157
+ assert_in_delta(2, method.children_time, 0.01)
158
+
159
+ assert_equal(1, method.call_infos.length)
160
+ call_info = method.call_infos[0]
161
+ assert_equal('RecursiveTest#test_cycle->Object#cycle', call_info.call_sequence)
162
+ assert_equal(1, call_info.children.length)
163
+
164
+ method = methods[2]
165
+ assert_equal('Object#sub_cycle', method.full_name)
166
+ assert_equal(1, method.called)
167
+ assert_in_delta(2, method.total_time, 0.01)
168
+ assert_in_delta(0, method.self_time, 0.01)
169
+ assert_in_delta(0, method.wait_time, 0.01)
170
+ assert_in_delta(2, method.children_time, 0.01)
171
+
172
+ assert_equal(1, method.call_infos.length)
173
+ call_info = method.call_infos[0]
174
+ assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle', call_info.call_sequence)
175
+ assert_equal(4, call_info.children.length)
176
+
177
+ method = methods[3]
178
+ assert_equal('Kernel#sleep', method.full_name)
179
+ assert_equal(2, method.called)
180
+ assert_in_delta(2, method.total_time, 0.01)
181
+ assert_in_delta(2, method.self_time, 0.01)
182
+ assert_in_delta(0, method.wait_time, 0.01)
183
+ assert_in_delta(0, method.children_time, 0.01)
184
+
185
+ assert_equal(2, method.call_infos.length)
186
+ call_info = method.call_infos[0]
187
+ assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Kernel#sleep', call_info.call_sequence)
188
+ assert_equal(0, call_info.children.length)
189
+
190
+ call_info = method.call_infos[1]
191
+ assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle-1->Object#sub_cycle-1->Kernel#sleep', call_info.call_sequence)
192
+ assert_equal(0, call_info.children.length)
193
+
194
+ method = methods[4]
195
+ assert_equal('Object#cycle-1', method.full_name)
196
+ assert_equal(1, method.called)
197
+ assert_in_delta(1, method.total_time, 0.01)
198
+ assert_in_delta(0, method.self_time, 0.01)
199
+ assert_in_delta(0, method.wait_time, 0.01)
200
+ assert_in_delta(1, method.children_time, 0.01)
201
+
202
+ assert_equal(1, method.call_infos.length)
203
+ call_info = method.call_infos[0]
204
+ assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle-1', call_info.call_sequence)
205
+ assert_equal(1, call_info.children.length)
206
+
207
+ method = methods[5]
208
+ assert_equal('Object#sub_cycle-1', method.full_name)
209
+ assert_equal(1, method.called)
210
+ assert_in_delta(1, method.total_time, 0.01)
211
+ assert_in_delta(0, method.self_time, 0.01)
212
+ assert_in_delta(0, method.wait_time, 0.01)
213
+ assert_in_delta(1, method.children_time, 0.01)
214
+
215
+ assert_equal(1, method.call_infos.length)
216
+ call_info = method.call_infos[0]
217
+ assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle-1->Object#sub_cycle-1', call_info.call_sequence)
218
+ assert_equal(3, call_info.children.length)
219
+
220
+ method = methods[6]
221
+ assert_equal('Fixnum#-', method.full_name)
222
+ assert_equal(2, method.called)
223
+ assert_in_delta(0, method.total_time, 0.01)
224
+ assert_in_delta(0, method.self_time, 0.01)
225
+ assert_in_delta(0, method.wait_time, 0.01)
226
+ assert_in_delta(0, method.children_time, 0.01)
227
+
228
+ assert_equal(2, method.call_infos.length)
229
+ call_info = method.call_infos[0]
230
+ assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Fixnum#-', call_info.call_sequence)
231
+ assert_equal(0, call_info.children.length)
232
+
233
+ call_info = method.call_infos[1]
234
+ assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle-1->Object#sub_cycle-1->Fixnum#-', call_info.call_sequence)
235
+ assert_equal(0, call_info.children.length)
236
+
237
+ method = methods[7]
238
+ assert_equal('Fixnum#==', method.full_name)
239
+ assert_equal(2, method.called)
240
+ assert_in_delta(0, method.total_time, 0.01)
241
+ assert_in_delta(0, method.self_time, 0.01)
242
+ assert_in_delta(0, method.wait_time, 0.01)
243
+ assert_in_delta(0, method.children_time, 0.01)
244
+
245
+ assert_equal(2, method.call_infos.length)
246
+ call_info = method.call_infos[0]
247
+ assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Fixnum#==', call_info.call_sequence)
248
+ assert_equal(0, call_info.children.length)
249
+
250
+ call_info = method.call_infos[1]
251
+ assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle-1->Object#sub_cycle-1->Fixnum#==', call_info.call_sequence)
252
+ assert_equal(0, call_info.children.length)
253
+ end
254
+ end
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require 'ruby-prof'
5
+ require 'timeout'
6
+
7
+ # -- Test for bug [#5657]
8
+ # http://rubyforge.org/tracker/index.php?func=detail&aid=5657&group_id=1814&atid=7060
9
+
10
+
11
+ class A
12
+ attr_accessor :as
13
+ def initialize
14
+ @as = []
15
+ class << @as
16
+ def <<(an_a)
17
+ super
18
+ end
19
+ end
20
+ end
21
+
22
+ def <<(an_a)
23
+ @as << an_a
24
+ end
25
+ end
26
+
27
+ class SingletonTest < Test::Unit::TestCase
28
+ def test_singleton
29
+ result = RubyProf.profile do
30
+ a = A.new
31
+ a << :first_thing
32
+ assert_equal(1, a.as.size)
33
+ end
34
+ printer = RubyProf::FlatPrinter.new(result)
35
+ printer.print(STDOUT)
36
+ end
37
+ end
@@ -0,0 +1,138 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require 'ruby-prof'
5
+
6
+ # Test data
7
+ # A
8
+ # / \
9
+ # B C
10
+ # \
11
+ # B
12
+
13
+ class StackClass
14
+ def a
15
+ sleep 1
16
+ b
17
+ c
18
+ end
19
+
20
+ def b
21
+ sleep 2
22
+ end
23
+
24
+ def c
25
+ sleep 3
26
+ b
27
+ end
28
+ end
29
+
30
+ class StackTest < Test::Unit::TestCase
31
+ def setup
32
+ # Need to use wall time for this test due to the sleep calls
33
+ RubyProf::measure_mode = RubyProf::WALL_TIME
34
+ end
35
+
36
+ def test_call_sequence
37
+ c = StackClass.new
38
+ result = RubyProf.profile do
39
+ c.a
40
+ end
41
+
42
+ # Length should be 5:
43
+ # StackTest#test_call_sequence
44
+ # StackClass#a
45
+ # Kernel#sleep
46
+ # StackClass#c
47
+ # StackClass#b
48
+
49
+ methods = result.threads.values.first.sort.reverse
50
+ assert_equal(5, methods.length)
51
+
52
+ # Check StackTest#test_call_sequence
53
+ method = methods[0]
54
+ assert_equal('StackTest#test_call_sequence', method.full_name)
55
+ assert_equal(1, method.called)
56
+ assert_in_delta(8, method.total_time, 0.01)
57
+ assert_in_delta(0, method.wait_time, 0.01)
58
+ assert_in_delta(0, method.self_time, 0.01)
59
+ assert_in_delta(8, method.children_time, 0.01)
60
+ assert_equal(1, method.call_infos.length)
61
+
62
+ call_info = method.call_infos[0]
63
+ assert_equal('StackTest#test_call_sequence', call_info.call_sequence)
64
+ assert_equal(1, call_info.children.length)
65
+
66
+ # Check StackClass#a
67
+ method = methods[1]
68
+ assert_equal('StackClass#a', method.full_name)
69
+ assert_equal(1, method.called)
70
+ assert_in_delta(8, method.total_time, 0.01)
71
+ assert_in_delta(0, method.wait_time, 0.01)
72
+ assert_in_delta(0, method.self_time, 0.01)
73
+ assert_in_delta(8, method.children_time, 0.01)
74
+ assert_equal(1, method.call_infos.length)
75
+
76
+ call_info = method.call_infos[0]
77
+ assert_equal('StackTest#test_call_sequence->StackClass#a', call_info.call_sequence)
78
+ assert_equal(3, call_info.children.length)
79
+
80
+ # Check Kernel#sleep
81
+ method = methods[2]
82
+ assert_equal('Kernel#sleep', method.full_name)
83
+ assert_equal(4, method.called)
84
+ assert_in_delta(8, method.total_time, 0.01)
85
+ assert_in_delta(0, method.wait_time, 0.01)
86
+ assert_in_delta(8, method.self_time, 0.01)
87
+ assert_in_delta(0, method.children_time, 0.01)
88
+ assert_equal(4, method.call_infos.length)
89
+
90
+ call_info = method.call_infos[0]
91
+ assert_equal('StackTest#test_call_sequence->StackClass#a->Kernel#sleep', call_info.call_sequence)
92
+ assert_equal(0, call_info.children.length)
93
+
94
+ call_info = method.call_infos[1]
95
+ assert_equal('StackTest#test_call_sequence->StackClass#a->StackClass#b->Kernel#sleep', call_info.call_sequence)
96
+ assert_equal(0, call_info.children.length)
97
+
98
+ call_info = method.call_infos[2]
99
+ assert_equal('StackTest#test_call_sequence->StackClass#a->StackClass#c->Kernel#sleep', call_info.call_sequence)
100
+ assert_equal(0, call_info.children.length)
101
+
102
+ call_info = method.call_infos[3]
103
+ assert_equal('StackTest#test_call_sequence->StackClass#a->StackClass#c->StackClass#b->Kernel#sleep', call_info.call_sequence)
104
+ assert_equal(0, call_info.children.length)
105
+
106
+ # Check StackClass#c
107
+ method = methods[3]
108
+ assert_equal('StackClass#c', method.full_name)
109
+ assert_equal(1, method.called)
110
+ assert_in_delta(5, method.total_time, 0.01)
111
+ assert_in_delta(0, method.wait_time, 0.01)
112
+ assert_in_delta(0, method.self_time, 0.01)
113
+ assert_in_delta(5, method.children_time, 0.01)
114
+ assert_equal(1, method.call_infos.length)
115
+
116
+ call_info = method.call_infos[0]
117
+ assert_equal('StackTest#test_call_sequence->StackClass#a->StackClass#c', call_info.call_sequence)
118
+ assert_equal(2, call_info.children.length)
119
+
120
+ # Check StackClass#b
121
+ method = methods[4]
122
+ assert_equal('StackClass#b', method.full_name)
123
+ assert_equal(2, method.called)
124
+ assert_in_delta(4, method.total_time, 0.01)
125
+ assert_in_delta(0, method.wait_time, 0.01)
126
+ assert_in_delta(0, method.self_time, 0.01)
127
+ assert_in_delta(4, method.children_time, 0.01)
128
+ assert_equal(2, method.call_infos.length)
129
+
130
+ call_info = method.call_infos[0]
131
+ assert_equal('StackTest#test_call_sequence->StackClass#a->StackClass#b', call_info.call_sequence)
132
+ assert_equal(1, call_info.children.length)
133
+
134
+ call_info = method.call_infos[1]
135
+ assert_equal('StackTest#test_call_sequence->StackClass#a->StackClass#c->StackClass#b', call_info.call_sequence)
136
+ assert_equal(1, call_info.children.length)
137
+ end
138
+ end
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require 'ruby-prof'
5
+
6
+ class StartStopTest < Test::Unit::TestCase
7
+ def setup
8
+ # Need to use wall time for this test due to the sleep calls
9
+ RubyProf::measure_mode = RubyProf::WALL_TIME
10
+ end
11
+
12
+ def method1
13
+ RubyProf.start
14
+ method2
15
+ end
16
+
17
+ def method2
18
+ method3
19
+ end
20
+
21
+ def method3
22
+ sleep(2)
23
+ @result = RubyProf.stop
24
+ end
25
+
26
+ def test_different_methods
27
+ method1
28
+
29
+ # Ruby prof should be stopped
30
+ assert_equal(false, RubyProf.running?)
31
+
32
+
33
+ # Length should be 4:
34
+ # StartStopTest#method1
35
+ # StartStopTest#method2
36
+ # StartStopTest#method3
37
+ # Kernel#sleep
38
+
39
+ methods = @result.threads.values.first.sort.reverse
40
+ assert_equal(4, methods.length)
41
+
42
+ # Check StackTest#test_call_sequence
43
+ method = methods[0]
44
+ assert_equal('StartStopTest#method1', method.full_name)
45
+ assert_equal(1, method.called)
46
+ assert_in_delta(2, method.total_time, 0.01)
47
+ assert_in_delta(0, method.wait_time, 0.01)
48
+ assert_in_delta(0, method.self_time, 0.01)
49
+ assert_in_delta(2, method.children_time, 0.01)
50
+ assert_equal(1, method.call_infos.length)
51
+
52
+ call_info = method.call_infos[0]
53
+ assert_equal('StartStopTest#method1', call_info.call_sequence)
54
+ assert_equal(1, call_info.children.length)
55
+
56
+ method = methods[1]
57
+ assert_equal('StartStopTest#method2', method.full_name)
58
+ assert_equal(1, method.called)
59
+ assert_in_delta(2, method.total_time, 0.01)
60
+ assert_in_delta(0, method.wait_time, 0.01)
61
+ assert_in_delta(0, method.self_time, 0.01)
62
+ assert_in_delta(2, method.children_time, 0.01)
63
+ assert_equal(1, method.call_infos.length)
64
+
65
+ call_info = method.call_infos[0]
66
+ assert_equal('StartStopTest#method1->StartStopTest#method2', call_info.call_sequence)
67
+ assert_equal(1, call_info.children.length)
68
+
69
+ method = methods[2]
70
+ assert_equal('StartStopTest#method3', method.full_name)
71
+ assert_equal(1, method.called)
72
+ assert_in_delta(2, method.total_time, 0.01)
73
+ assert_in_delta(0, method.wait_time, 0.01)
74
+ assert_in_delta(0, method.self_time, 0.01)
75
+ assert_in_delta(2, method.children_time, 0.01)
76
+ assert_equal(1, method.call_infos.length)
77
+
78
+ call_info = method.call_infos[0]
79
+ assert_equal('StartStopTest#method1->StartStopTest#method2->StartStopTest#method3', call_info.call_sequence)
80
+ assert_equal(1, call_info.children.length)
81
+
82
+ method = methods[3]
83
+ assert_equal('Kernel#sleep', method.full_name)
84
+ assert_equal(1, method.called)
85
+ assert_in_delta(2, method.total_time, 0.01)
86
+ assert_in_delta(0, method.wait_time, 0.01)
87
+ assert_in_delta(2, method.self_time, 0.01)
88
+ assert_in_delta(0, method.children_time, 0.01)
89
+ assert_equal(1, method.call_infos.length)
90
+
91
+ call_info = method.call_infos[0]
92
+ assert_equal('StartStopTest#method1->StartStopTest#method2->StartStopTest#method3->Kernel#sleep', call_info.call_sequence)
93
+ assert_equal(0, call_info.children.length)
94
+ end
95
+ end