ruby-prof 0.10.8 → 0.11.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. data/CHANGES +38 -18
  2. data/LICENSE +4 -3
  3. data/README.rdoc +30 -66
  4. data/Rakefile +47 -54
  5. data/bin/ruby-prof +24 -4
  6. data/ext/ruby_prof/extconf.rb +9 -16
  7. data/ext/ruby_prof/rp_call_info.c +369 -0
  8. data/ext/ruby_prof/rp_call_info.h +46 -0
  9. data/ext/ruby_prof/rp_measure.c +48 -0
  10. data/ext/ruby_prof/rp_measure.h +45 -0
  11. data/ext/ruby_prof/rp_measure_allocations.c +86 -0
  12. data/ext/ruby_prof/rp_measure_cpu_time.c +112 -0
  13. data/ext/ruby_prof/rp_measure_gc_runs.c +87 -0
  14. data/ext/ruby_prof/rp_measure_gc_time.c +73 -0
  15. data/ext/ruby_prof/rp_measure_memory.c +81 -0
  16. data/ext/ruby_prof/rp_measure_process_time.c +71 -0
  17. data/ext/ruby_prof/rp_measure_wall_time.c +42 -0
  18. data/ext/ruby_prof/rp_method.c +363 -0
  19. data/ext/ruby_prof/rp_method.h +55 -0
  20. data/ext/ruby_prof/rp_stack.c +61 -0
  21. data/ext/ruby_prof/rp_stack.h +40 -0
  22. data/ext/ruby_prof/rp_thread.c +113 -0
  23. data/ext/ruby_prof/rp_thread.h +20 -0
  24. data/ext/ruby_prof/ruby_prof.c +259 -1398
  25. data/ext/ruby_prof/ruby_prof.h +54 -190
  26. data/ext/ruby_prof/version.h +6 -3
  27. data/lib/1.8/ruby_prof.so +0 -0
  28. data/lib/1.9/ruby_prof.exp +0 -0
  29. data/lib/1.9/ruby_prof.ilk +0 -0
  30. data/lib/1.9/ruby_prof.lib +0 -0
  31. data/lib/1.9/ruby_prof.pdb +0 -0
  32. data/lib/1.9/ruby_prof.so +0 -0
  33. data/lib/ruby-prof.rb +14 -11
  34. data/lib/ruby-prof/abstract_printer.rb +10 -0
  35. data/lib/ruby-prof/aggregate_call_info.rb +2 -0
  36. data/lib/ruby-prof/call_info.rb +2 -0
  37. data/lib/ruby-prof/call_stack_printer.rb +2 -4
  38. data/lib/ruby-prof/call_tree_printer.rb +1 -0
  39. data/lib/ruby-prof/compatibility.rb +134 -0
  40. data/lib/ruby-prof/dot_printer.rb +7 -7
  41. data/lib/ruby-prof/flat_printer.rb +7 -7
  42. data/lib/ruby-prof/flat_printer_with_line_numbers.rb +2 -5
  43. data/lib/ruby-prof/graph_html_printer.rb +4 -2
  44. data/lib/ruby-prof/graph_printer.rb +4 -3
  45. data/lib/ruby-prof/method_info.rb +2 -0
  46. data/lib/ruby-prof/multi_printer.rb +2 -0
  47. data/lib/ruby-prof/{result.rb → profile.rb} +3 -1
  48. data/lib/ruby-prof/rack.rb +1 -0
  49. data/lib/ruby-prof/symbol_to_proc.rb +2 -0
  50. data/lib/ruby-prof/task.rb +1 -0
  51. data/lib/ruby-prof/test.rb +2 -0
  52. data/lib/ruby_prof.exp +0 -0
  53. data/lib/ruby_prof.ilk +0 -0
  54. data/lib/ruby_prof.lib +0 -0
  55. data/lib/ruby_prof.pdb +0 -0
  56. data/lib/ruby_prof.so +0 -0
  57. data/lib/unprof.rb +2 -0
  58. data/test/aggregate_test.rb +8 -8
  59. data/test/basic_test.rb +3 -251
  60. data/test/bug_test.rb +6 -0
  61. data/test/duplicate_names_test.rb +2 -2
  62. data/test/dynamic_method_test.rb +61 -0
  63. data/test/enumerable_test.rb +2 -2
  64. data/test/exceptions_test.rb +4 -3
  65. data/test/exclude_threads_test.rb +2 -2
  66. data/test/exec_test.rb +3 -3
  67. data/test/line_number_test.rb +5 -5
  68. data/test/measure_allocations_test.rb +25 -0
  69. data/test/measure_cpu_time_test.rb +212 -0
  70. data/test/measure_gc_runs_test.rb +29 -0
  71. data/test/measure_gc_time_test.rb +29 -0
  72. data/test/measure_memory_test.rb +36 -0
  73. data/test/measure_process_time_test.rb +205 -0
  74. data/test/measure_wall_time_test.rb +209 -0
  75. data/test/method_elimination_test.rb +2 -2
  76. data/test/module_test.rb +3 -2
  77. data/test/multi_printer_test.rb +2 -2
  78. data/test/no_method_class_test.rb +3 -1
  79. data/test/prime_test.rb +3 -3
  80. data/test/printers_test.rb +106 -8
  81. data/test/recursive_test.rb +7 -6
  82. data/test/singleton_test.rb +2 -2
  83. data/test/stack_printer_test.rb +2 -3
  84. data/test/stack_test.rb +2 -2
  85. data/test/start_stop_test.rb +2 -2
  86. data/test/test_helper.rb +81 -0
  87. data/test/test_suite.rb +34 -29
  88. data/test/thread_test.rb +24 -23
  89. data/test/unique_call_path_test.rb +2 -2
  90. metadata +101 -69
  91. data/ext/ruby_prof/measure_allocations.h +0 -83
  92. data/ext/ruby_prof/measure_cpu_time.h +0 -152
  93. data/ext/ruby_prof/measure_gc_runs.h +0 -76
  94. data/ext/ruby_prof/measure_gc_time.h +0 -57
  95. data/ext/ruby_prof/measure_memory.h +0 -101
  96. data/ext/ruby_prof/measure_process_time.h +0 -63
  97. data/ext/ruby_prof/measure_wall_time.h +0 -53
  98. data/ext/ruby_prof/mingw/Rakefile +0 -23
  99. data/ext/ruby_prof/mingw/build.rake +0 -38
  100. data/rails/environment/profile.rb +0 -24
  101. data/rails/example/example_test.rb +0 -9
  102. data/rails/profile_test_helper.rb +0 -21
  103. data/test/current_failures_windows +0 -8
  104. data/test/measurement_test.rb +0 -132
  105. data/test/ruby-prof-bin +0 -20
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ # encoding: UTF-8
2
3
 
3
- require 'test/unit'
4
- require 'ruby-prof'
4
+ require File.expand_path('../test_helper', __FILE__)
5
5
  require 'tmpdir'
6
6
 
7
7
  # Test data
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- require 'test/unit'
3
- require 'ruby-prof'
2
+ # encoding: UTF-8
3
+
4
+ require File.expand_path('../test_helper', __FILE__)
4
5
 
5
6
  # Need to use wall time for this test due to the sleep calls
6
7
  RubyProf::measure_mode = RubyProf::WALL_TIME
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ # encoding: UTF-8
2
3
 
3
- require 'test/unit'
4
- require 'ruby-prof'
4
+ require File.expand_path('../test_helper', __FILE__)
5
5
  require 'tmpdir'
6
6
 
7
7
  # Test data
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- require 'ruby-prof'
2
+ # encoding: UTF-8
3
+
4
+ require File.expand_path('../test_helper', __FILE__)
3
5
 
4
6
  # Make sure this works with no class or method
5
7
  result = RubyProf.profile do
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- require 'test/unit'
3
- require 'ruby-prof'
4
- require 'prime'
2
+ # encoding: UTF-8
3
+
4
+ require File.expand_path('../test_helper', __FILE__)
5
5
 
6
6
  # -- Tests ----
7
7
  class PrimeTest< Test::Unit::TestCase
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
- require 'test/unit'
3
- require 'ruby-prof'
4
- require File.dirname(__FILE__) + '/prime'
2
+ # encoding: UTF-8
3
+
4
+ require File.expand_path('../test_helper', __FILE__)
5
5
  require 'stringio'
6
6
  require 'fileutils'
7
- require 'rubygems'
8
7
 
9
8
  # -- Tests ----
10
9
  class PrintersTest < Test::Unit::TestCase
@@ -45,12 +44,12 @@ class PrintersTest < Test::Unit::TestCase
45
44
  printer = RubyProf::CallTreePrinter.new(@result)
46
45
  printer.print(output)
47
46
  output_dir = 'examples2'
48
-
47
+
49
48
  if ENV['SAVE_NEW_PRINTER_EXAMPLES']
50
49
  output_dir = 'examples'
51
50
  end
52
51
  FileUtils.mkdir_p output_dir
53
-
52
+
54
53
  printer = RubyProf::DotPrinter.new(@result)
55
54
  File.open("#{output_dir}/graph.dot", "w") {|f| printer.print(f)}
56
55
 
@@ -135,7 +134,6 @@ class PrintersTest < Test::Unit::TestCase
135
134
  end
136
135
 
137
136
  def test_all_with_small_percentiles
138
-
139
137
  result = RubyProf.profile do
140
138
  sleep 2
141
139
  do_nothing
@@ -147,12 +145,112 @@ class PrintersTest < Test::Unit::TestCase
147
145
  for klass in [ RubyProf::GraphPrinter, RubyProf::GraphHtmlPrinter]
148
146
  printer = klass.new(result)
149
147
  out = ''
150
- output = printer.print(out, :min_percent => 0.00000001 )
148
+ printer.print(out, :min_percent => 0.00000001 )
151
149
  assert_match(/do_nothing/, out)
152
150
  end
153
151
 
154
152
  end
155
153
 
154
+ def test_flat_result_sorting_by_self_time_is_default
155
+ printer = RubyProf::FlatPrinter.new(@result)
156
+
157
+ printer.print(output = '')
158
+ self_times = flat_output_nth_column_values(output, 3)
159
+
160
+ assert_sorted self_times
161
+ end
162
+
163
+ def test_flat_result_sorting
164
+ printer = RubyProf::FlatPrinter.new(@result)
165
+
166
+ sort_method_with_column_number = {:total_time => 2, :self_time => 3, :wait_time => 4, :children_time => 5}
167
+
168
+ sort_method_with_column_number.each_pair do |sort_method, n|
169
+ printer.print(output = '', :sort_method => sort_method)
170
+ times = flat_output_nth_column_values(output, n)
171
+ assert_sorted times
172
+ end
173
+ end
174
+
175
+ def test_flat_result_with_line_numbers_sorting_by_self_time_is_default
176
+ printer = RubyProf::FlatPrinterWithLineNumbers.new(@result)
177
+
178
+ printer.print(output = '')
179
+ self_times = flat_output_nth_column_values(output, 3)
180
+
181
+ assert_sorted self_times
182
+ end
183
+
184
+ def test_flat_with_line_numbers_result_sorting
185
+ printer = RubyProf::FlatPrinterWithLineNumbers.new(@result)
186
+
187
+ sort_method_with_column_number = {:total_time => 2, :self_time => 3, :wait_time => 4, :children_time => 5}
188
+
189
+ sort_method_with_column_number.each_pair do |sort_method, n|
190
+ printer.print(output = '', :sort_method => sort_method)
191
+ times = flat_output_nth_column_values(output, n)
192
+ assert_sorted times
193
+ end
194
+ end
195
+
196
+ def test_graph_result_sorting_by_total_time_is_default
197
+ printer = RubyProf::GraphPrinter.new(@result)
198
+ printer.print(output = '')
199
+ total_times = graph_output_nth_column_values(output, 3)
156
200
 
201
+ assert_sorted total_times
202
+ end
157
203
 
204
+ def test_graph_results_sorting
205
+ printer = RubyProf::GraphPrinter.new(@result)
206
+
207
+ sort_method_with_column_number = {:total_time => 3, :self_time => 4, :wait_time => 5, :children_time => 6}
208
+
209
+ sort_method_with_column_number.each_pair do |sort_method, n|
210
+ printer.print(output = '', :sort_method => sort_method)
211
+ times = graph_output_nth_column_values(output, n)
212
+ assert_sorted times
213
+ end
214
+ end
215
+
216
+ def test_graph_html_result_sorting_by_total_time_is_default
217
+ printer = RubyProf::GraphHtmlPrinter.new(@result)
218
+ printer.print(output = '')
219
+ total_times = graph_html_output_nth_column_values(output, 3)
220
+
221
+ assert_sorted total_times
222
+ end
223
+
224
+ def test_graph_html_result_sorting
225
+ printer = RubyProf::GraphHtmlPrinter.new(@result)
226
+
227
+ sort_method_with_column_number = {:total_time => 3, :self_time => 4, :wait_time => 5, :children_time => 6}
228
+
229
+ sort_method_with_column_number.each_pair do |sort_method, n|
230
+ printer.print(output = '', :sort_method => sort_method)
231
+ times = graph_html_output_nth_column_values(output, n)
232
+ assert_sorted times
233
+ end
234
+ end
235
+
236
+ private
237
+ def flat_output_nth_column_values(output, n)
238
+ only_method_calls = output.split("\n").select { |line| line =~ /^ +\d+/ }
239
+ only_method_calls.collect { |line| line.split(/ +/)[n] }
240
+ end
241
+
242
+ def graph_output_nth_column_values(output, n)
243
+ only_root_calls = output.split("\n").select { |line| line =~ /^ +[\d\.]+%/ }
244
+ only_root_calls.collect { |line| line.split(/ +/)[n] }
245
+ end
246
+
247
+ def graph_html_output_nth_column_values(output, n)
248
+ only_root_calls = output.split('<tr class="method">')
249
+ only_root_calls.delete_at(0)
250
+ only_root_calls.collect {|line| line.scan(/[\d\.]+/)[n - 1] }
251
+ end
252
+
253
+ def assert_sorted array
254
+ assert_equal array, array.sort.reverse, "Array #{array.inspect} is not sorted"
255
+ end
158
256
  end
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- require 'test/unit'
3
- require 'ruby-prof'
2
+ # encoding: UTF-8
3
+
4
+ require File.expand_path('../test_helper', __FILE__)
4
5
 
5
6
  def simple(n)
6
7
  sleep(1)
@@ -57,10 +58,10 @@ class RecursiveTest < Test::Unit::TestCase
57
58
  method = methods[1]
58
59
  assert_equal('Object#simple', method.full_name)
59
60
  assert_equal(2, method.called)
60
- assert_in_delta(2, method.total_time, 0.02)
61
- assert_in_delta(0, method.self_time, 0.02)
62
- assert_in_delta(0, method.wait_time, 0.02)
63
- assert_in_delta(2, method.children_time, 0.02)
61
+ assert_in_delta(2, method.total_time, 0.05)
62
+ assert_in_delta(0, method.self_time, 0.05)
63
+ assert_in_delta(0, method.wait_time, 0.05)
64
+ assert_in_delta(2, method.children_time, 0.05)
64
65
 
65
66
  assert_equal(2, method.call_infos.length)
66
67
  call_info = method.call_infos[0]
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ # encoding: UTF-8
2
3
 
3
- require 'test/unit'
4
- require 'ruby-prof'
4
+ require File.expand_path('../test_helper', __FILE__)
5
5
  require 'timeout'
6
6
 
7
7
  # -- Test for bug [#5657]
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ # encoding: UTF-8
2
3
 
3
- require 'test/unit'
4
- require 'ruby-prof'
4
+ require File.expand_path('../test_helper', __FILE__)
5
5
  require 'tmpdir'
6
6
 
7
7
  # Test data
@@ -45,7 +45,6 @@ class StackPrinterTest < Test::Unit::TestCase
45
45
  assert_nothing_raised { file_contents = print(result) }
46
46
  assert file_contents =~ /Thread: (\d+) \(100\.00% ~ ([.0-9]+)\)/
47
47
  actual_time = $2.to_f
48
- difference = (expected_time-actual_time).abs
49
48
  assert_in_delta(expected_time, actual_time, 0.01)
50
49
  end
51
50
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ # encoding: UTF-8
2
3
 
3
- require 'test/unit'
4
- require 'ruby-prof'
4
+ require File.expand_path('../test_helper', __FILE__)
5
5
 
6
6
  # Test data
7
7
  # A
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ # encoding: UTF-8
2
3
 
3
- require 'test/unit'
4
- require 'ruby-prof'
4
+ require File.expand_path('../test_helper', __FILE__)
5
5
 
6
6
  class StartStopTest < Test::Unit::TestCase
7
7
  def setup
@@ -0,0 +1,81 @@
1
+ # encoding: UTF-8
2
+
3
+ # Make RubyMine happy
4
+ if ENV["RM_INFO"] || ENV["TEAMCITY_VERSION"]
5
+ gem 'win32console'
6
+ gem 'minitest-reporters'
7
+ require 'minitest/reporters'
8
+ MiniTest::Unit.runner = MiniTest::SuiteRunner.new
9
+ MiniTest::Unit.runner.reporters << MiniTest::Reporters::RubyMineReporter.new
10
+ end
11
+
12
+ # To make testing/debugging easier, test within this source tree versus an installed gem
13
+
14
+ dir = File.dirname(__FILE__)
15
+ root = File.expand_path(File.join(dir, '..'))
16
+ lib = File.expand_path(File.join(root, 'lib'))
17
+ ext = File.expand_path(File.join(root, 'ext', 'ruby_prof'))
18
+
19
+ $LOAD_PATH << lib
20
+ $LOAD_PATH << ext
21
+
22
+ require 'ruby-prof'
23
+ require 'test/unit'
24
+ require File.expand_path('../prime', __FILE__)
25
+
26
+ # Some classes used in measurement tests
27
+ module RubyProf
28
+ class C1
29
+ def C1.hello
30
+ sleep(0.1)
31
+ end
32
+
33
+ def hello
34
+ sleep(0.2)
35
+ end
36
+ end
37
+
38
+ module M1
39
+ def hello
40
+ sleep(0.3)
41
+ end
42
+ end
43
+
44
+ class C2
45
+ include M1
46
+ extend M1
47
+ end
48
+
49
+ class C3
50
+ def hello
51
+ sleep(0.4)
52
+ end
53
+ end
54
+
55
+ module M4
56
+ def hello
57
+ sleep(0.5)
58
+ end
59
+ end
60
+
61
+ module M5
62
+ include M4
63
+ def goodbye
64
+ hello
65
+ end
66
+ end
67
+
68
+ class C6
69
+ include M5
70
+ def test
71
+ goodbye
72
+ end
73
+ end
74
+
75
+ if RUBY_VERSION < '1.9'
76
+ PARENT = Object
77
+ else
78
+ PARENT = BasicObject
79
+ end
80
+
81
+ end
@@ -1,32 +1,37 @@
1
- begin
2
- require 'rubygems'
3
- require 'redgreen'
4
- rescue LoadError
5
- end
1
+ # encoding: utf-8
2
+
3
+ require File.expand_path("../test_helper", __FILE__)
6
4
 
7
- require 'test/unit'
5
+ %w(aggregate_test
6
+ basic_test
7
+ duplicate_names_test
8
+ dynamic_method_test
9
+ enumerable_test
10
+ exceptions_test
11
+ exclude_threads_test
12
+ line_number_test
8
13
 
9
- require 'aggregate_test'
10
- require 'basic_test'
11
- require 'duplicate_names_test'
12
- require 'exceptions_test'
13
- require 'line_number_test'
14
- require 'measurement_test'
15
- require 'module_test'
16
- require 'no_method_class_test'
17
- require 'prime_test'
18
- require 'printers_test'
19
- require 'recursive_test'
20
- require 'singleton_test'
21
- require 'stack_test'
22
- require 'start_stop_test'
23
- require 'thread_test'
24
- require 'unique_call_path_test'
25
- require 'stack_printer_test'
26
- require 'multi_printer_test'
27
- require 'method_elimination_test'
14
+ measure_allocations_test
15
+ measure_cpu_time_test
16
+ measure_gc_runs_test
17
+ measure_gc_time_test
18
+ measure_memory_test
19
+ measure_process_time_test
20
+ measure_wall_time_test
21
+
22
+ method_elimination_test
23
+ module_test
24
+ multi_printer_test
25
+ no_method_class_test
26
+ prime_test
27
+ printers_test
28
+ recursive_test
29
+ singleton_test
30
+ stack_test
31
+ stack_printer_test
32
+ start_stop_test
33
+ thread_test
34
+ unique_call_path_test).each do |test|
35
+ require File.expand_path("../#{test}", __FILE__)
36
+ end
28
37
 
29
- # Can't use this one here cause it breaks
30
- # the rest of the unit tets (Ruby Prof gets
31
- # started twice).
32
- #require 'profile_unit_test'
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- require 'test/unit'
3
- require 'ruby-prof'
2
+ # encoding: UTF-8
3
+
4
+ require File.expand_path('../test_helper', __FILE__)
4
5
  require 'timeout'
5
6
 
6
7
  # -- Tests ----
@@ -65,9 +66,9 @@ class ThreadTest < Test::Unit::TestCase
65
66
  assert_equal('ThreadTest#test_thread_timings', method.full_name)
66
67
  assert_equal(1, method.called)
67
68
  assert_in_delta(1, method.total_time, 0.05)
68
- assert_in_delta(0, method.self_time, 0.01)
69
- assert_in_delta(0, method.wait_time, 0.01)
70
- assert_in_delta(1, method.children_time, 0.01)
69
+ assert_in_delta(0, method.self_time, 0.05)
70
+ assert_in_delta(0, method.wait_time, 0.05)
71
+ assert_in_delta(1, method.children_time, 0.05)
71
72
  assert_equal(1, method.call_infos.length)
72
73
  call_info = method.call_infos[0]
73
74
  assert_equal('ThreadTest#test_thread_timings', call_info.call_sequence)
@@ -76,10 +77,10 @@ class ThreadTest < Test::Unit::TestCase
76
77
  method = methods[1]
77
78
  assert_equal('Kernel#sleep', method.full_name)
78
79
  assert_equal(2, method.called)
79
- assert_in_delta(1, method.total_time, 0.01)
80
- assert_in_delta(1.0, method.self_time, 0.01)
81
- assert_in_delta(0, method.wait_time, 0.01)
82
- assert_in_delta(0, method.children_time, 0.01)
80
+ assert_in_delta(1, method.total_time, 0.05)
81
+ assert_in_delta(1.0, method.self_time, 0.05)
82
+ assert_in_delta(0, method.wait_time, 0.05)
83
+ assert_in_delta(0, method.children_time, 0.05)
83
84
 
84
85
  assert_equal(1, method.call_infos.length)
85
86
  call_info = method.call_infos[0]
@@ -97,10 +98,10 @@ class ThreadTest < Test::Unit::TestCase
97
98
  # cause the parent frame to be created for method #test_thread_timings, which means a +1 when it's popped in the end
98
99
  # xxxx a test that shows it the other way, too (never creates parent frame--if that's even possible)
99
100
  assert_equal(1, method.called)
100
- assert_in_delta(1, method.total_time, 0.01)
101
+ assert_in_delta(1, method.total_time, 0.05)
101
102
  assert_in_delta(0, method.self_time, 0.05)
102
103
  assert_in_delta(0, method.wait_time, 0.05)
103
- assert_in_delta(1, method.children_time, 0.01)
104
+ assert_in_delta(1, method.children_time, 0.05)
104
105
 
105
106
  assert_equal(1, method.call_infos.length)
106
107
  call_info = method.call_infos[0]
@@ -110,10 +111,10 @@ class ThreadTest < Test::Unit::TestCase
110
111
  method = methods[1]
111
112
  assert_equal('Thread#join', method.full_name)
112
113
  assert_equal(1, method.called)
113
- assert_in_delta(1, method.total_time, 0.01)
114
- assert_in_delta(0, method.self_time, 0.01)
115
- assert_in_delta(1.0, method.wait_time, 0.01)
116
- assert_in_delta(0, method.children_time, 0.01)
114
+ assert_in_delta(1, method.total_time, 0.05)
115
+ assert_in_delta(0, method.self_time, 0.05)
116
+ assert_in_delta(1.0, method.wait_time, 0.05)
117
+ assert_in_delta(0, method.children_time, 0.05)
117
118
 
118
119
  assert_equal(1, method.call_infos.length)
119
120
  call_info = method.call_infos[0]
@@ -123,10 +124,10 @@ class ThreadTest < Test::Unit::TestCase
123
124
  method = methods[2]
124
125
  assert_equal('<Class::Thread>#new', method.full_name)
125
126
  assert_equal(1, method.called)
126
- assert_in_delta(0, method.total_time, 0.01)
127
- assert_in_delta(0, method.self_time, 0.01)
128
- assert_in_delta(0, method.wait_time, 0.01)
129
- assert_in_delta(0, method.children_time, 0.01)
127
+ assert_in_delta(0, method.total_time, 0.05)
128
+ assert_in_delta(0, method.self_time, 0.05)
129
+ assert_in_delta(0, method.wait_time, 0.05)
130
+ assert_in_delta(0, method.children_time, 0.05)
130
131
 
131
132
  assert_equal(1, method.call_infos.length)
132
133
  call_info = method.call_infos[0]
@@ -136,10 +137,10 @@ class ThreadTest < Test::Unit::TestCase
136
137
  method = methods[3]
137
138
  assert_equal('Thread#initialize', method.full_name)
138
139
  assert_equal(1, method.called)
139
- assert_in_delta(0, method.total_time, 0.01)
140
- assert_in_delta(0, method.self_time, 0.01)
141
- assert_in_delta(0, method.wait_time, 0.01)
142
- assert_in_delta(0, method.children_time, 0.01)
140
+ assert_in_delta(0, method.total_time, 0.05)
141
+ assert_in_delta(0, method.self_time, 0.05)
142
+ assert_in_delta(0, method.wait_time, 0.05)
143
+ assert_in_delta(0, method.children_time, 0.05)
143
144
 
144
145
  assert_equal(1, method.call_infos.length)
145
146
  call_info = method.call_infos[0]