ruby-prof 0.7.6 → 0.7.7
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.
- data/CHANGES +5 -0
- data/README +12 -17
- data/Rakefile +18 -2
- data/ext/extconf.rb +0 -2
- data/ext/ruby_prof.c +18 -3
- data/ext/ruby_prof.h +1 -1
- data/ext/version.h +2 -2
- data/lib/out_18 +2228 -0
- data/lib/out_19 +2110 -0
- data/lib/ruby-prof/flat_printer.rb +1 -1
- data/lib/ruby-prof/graph_html_printer.rb +1 -1
- data/lib/ruby-prof/graph_printer.rb +1 -1
- data/lib/ruby-prof/method_info.rb +1 -1
- data/lib/ruby-prof/test.rb +1 -1
- data/test/aggregate_test.rb +1 -1
- data/test/basic_test.rb +28 -28
- data/test/current_failures_windows +4 -16
- data/test/recursive_test.rb +3 -3
- data/test/stack_test.rb +4 -4
- data/test/start_stop_test.rb +2 -2
- data/test/thread_test.rb +10 -12
- metadata +4 -4
- data/lib/test.rb +0 -6
- data/lib/test2.rb +0 -4
@@ -62,7 +62,7 @@ module RubyProf
|
|
62
62
|
# Cache thread times since this is an expensive
|
63
63
|
# operation with the required sorting
|
64
64
|
@result.threads.each do |thread_id, methods|
|
65
|
-
top = methods.
|
65
|
+
top = methods.max
|
66
66
|
|
67
67
|
thread_time = 0.01
|
68
68
|
thread_time = top.total_time if top.total_time > 0
|
@@ -36,7 +36,7 @@ module RubyProf
|
|
36
36
|
# Cache thread times since this is an expensive
|
37
37
|
# operation with the required sorting
|
38
38
|
@result.threads.each do |thread_id, methods|
|
39
|
-
top = methods.
|
39
|
+
top = methods.max
|
40
40
|
|
41
41
|
thread_time = 0.01
|
42
42
|
thread_time = top.total_time if top.total_time > 0
|
data/lib/ruby-prof/test.rb
CHANGED
data/test/aggregate_test.rb
CHANGED
@@ -88,7 +88,7 @@ class AggregateTest < Test::Unit::TestCase
|
|
88
88
|
assert_equal('AggClass#a', call_info.parent.target.full_name)
|
89
89
|
assert_in_delta(3, call_info.total_time, 0.05)
|
90
90
|
assert_in_delta(0, call_info.wait_time, 0.01)
|
91
|
-
assert_in_delta(0, call_info.self_time, 0.
|
91
|
+
assert_in_delta(0, call_info.self_time, 0.05)
|
92
92
|
assert_in_delta(3, call_info.children_time, 0.05)
|
93
93
|
assert_equal(3, call_info.called)
|
94
94
|
end
|
data/test/basic_test.rb
CHANGED
@@ -137,14 +137,14 @@ class BasicTest < Test::Unit::TestCase
|
|
137
137
|
|
138
138
|
methods = result.threads.values.first.sort.reverse
|
139
139
|
assert_equal(6, methods.length)
|
140
|
-
|
141
|
-
assert_equal('BasicTest#test_instance_methods',
|
142
|
-
assert_equal('C1#hello',
|
143
|
-
assert_equal('Kernel#sleep',
|
144
|
-
assert_equal('Class#new',
|
145
|
-
|
146
|
-
|
147
|
-
|
140
|
+
names = methods.map &:full_name
|
141
|
+
assert_equal('BasicTest#test_instance_methods', names[0])
|
142
|
+
assert_equal('C1#hello', names[1])
|
143
|
+
assert_equal('Kernel#sleep', names[2])
|
144
|
+
assert_equal('Class#new', names[3])
|
145
|
+
# order can differ
|
146
|
+
assert(names.include?("<Class::#{PARENT}>#allocate"))
|
147
|
+
assert(names.include?("#{PARENT}#initialize"))
|
148
148
|
|
149
149
|
# Check times
|
150
150
|
assert_in_delta(0.2, methods[0].total_time, 0.02)
|
@@ -190,17 +190,17 @@ class BasicTest < Test::Unit::TestCase
|
|
190
190
|
assert_equal('Kernel#sleep', methods[2].full_name)
|
191
191
|
|
192
192
|
# Check times
|
193
|
-
assert_in_delta(0.3, methods[0].total_time, 0.
|
194
|
-
assert_in_delta(0, methods[0].wait_time, 0.
|
195
|
-
assert_in_delta(0, methods[0].self_time, 0.
|
193
|
+
assert_in_delta(0.3, methods[0].total_time, 0.1)
|
194
|
+
assert_in_delta(0, methods[0].wait_time, 0.02)
|
195
|
+
assert_in_delta(0, methods[0].self_time, 0.02)
|
196
196
|
|
197
|
-
assert_in_delta(0.3, methods[1].total_time, 0.
|
198
|
-
assert_in_delta(0, methods[1].wait_time, 0.
|
199
|
-
assert_in_delta(0, methods[1].self_time, 0.
|
197
|
+
assert_in_delta(0.3, methods[1].total_time, 0.1)
|
198
|
+
assert_in_delta(0, methods[1].wait_time, 0.02)
|
199
|
+
assert_in_delta(0, methods[1].self_time, 0.02)
|
200
200
|
|
201
|
-
assert_in_delta(0.3, methods[2].total_time, 0.
|
202
|
-
assert_in_delta(0, methods[2].wait_time, 0.
|
203
|
-
assert_in_delta(0.3, methods[2].self_time, 0.
|
201
|
+
assert_in_delta(0.3, methods[2].total_time, 0.1)
|
202
|
+
assert_in_delta(0, methods[2].wait_time, 0.02)
|
203
|
+
assert_in_delta(0.3, methods[2].self_time, 0.1)
|
204
204
|
end
|
205
205
|
|
206
206
|
def test_module_instance_methods
|
@@ -218,18 +218,18 @@ class BasicTest < Test::Unit::TestCase
|
|
218
218
|
|
219
219
|
methods = result.threads.values.first.sort.reverse
|
220
220
|
assert_equal(6, methods.length)
|
221
|
-
|
222
|
-
assert_equal('BasicTest#test_module_instance_methods',
|
223
|
-
assert_equal('M1#hello',
|
224
|
-
assert_equal('Kernel#sleep',
|
225
|
-
assert_equal('Class#new',
|
226
|
-
|
227
|
-
|
221
|
+
names = methods.map &:full_name
|
222
|
+
assert_equal('BasicTest#test_module_instance_methods', names[0])
|
223
|
+
assert_equal('M1#hello', names[1])
|
224
|
+
assert_equal('Kernel#sleep', names[2])
|
225
|
+
assert_equal('Class#new', names[3])
|
226
|
+
assert(names.include?("<Class::#{PARENT}>#allocate"))
|
227
|
+
assert(names.include?("#{PARENT}#initialize"))
|
228
228
|
|
229
229
|
# Check times
|
230
|
-
assert_in_delta(0.3, methods[0].total_time, 0.
|
231
|
-
assert_in_delta(0, methods[0].wait_time, 0.
|
232
|
-
assert_in_delta(0, methods[0].self_time, 0.
|
230
|
+
assert_in_delta(0.3, methods[0].total_time, 0.1)
|
231
|
+
assert_in_delta(0, methods[0].wait_time, 0.1)
|
232
|
+
assert_in_delta(0, methods[0].self_time, 0.1)
|
233
233
|
|
234
234
|
assert_in_delta(0.3, methods[1].total_time, 0.02)
|
235
235
|
assert_in_delta(0, methods[1].wait_time, 0.01)
|
@@ -287,4 +287,4 @@ class BasicTest < Test::Unit::TestCase
|
|
287
287
|
|
288
288
|
RubyProf.stop
|
289
289
|
end
|
290
|
-
end
|
290
|
+
end
|
@@ -1,20 +1,8 @@
|
|
1
1
|
1.8 passes, 1.9 however...
|
2
2
|
|
3
|
-
|
4
3
|
1) Failure:
|
5
|
-
|
6
|
-
|
7
|
-
<1>.
|
8
|
-
|
9
|
-
2) Failure:
|
10
|
-
test_thread_identity(ThreadTest) [E:/dev/ruby/ruby-prof/test/thread_test.rb:37]:
|
11
|
-
<2> expected but was
|
12
|
-
<1>.
|
13
|
-
|
14
|
-
3) Failure:
|
15
|
-
test_thread_timings(ThreadTest) [E:/dev/ruby/ruby-prof/test/thread_test.rb:58]:
|
16
|
-
<2> expected but was
|
17
|
-
<1>.
|
4
|
+
test_thread_timings(ThreadTest) [E:/dev/ruby/ruby-prof/test/thread_test.rb:76]:
|
5
|
+
Expected 0 - 1.0 (1.0) to be < 0.01.
|
18
6
|
|
19
|
-
43 tests,
|
20
|
-
rake aborted!
|
7
|
+
43 tests, 410 assertions, 1 failures, 0 errors, 0 skips
|
8
|
+
rake aborted!
|
data/test/recursive_test.rb
CHANGED
@@ -181,8 +181,8 @@ class RecursiveTest < Test::Unit::TestCase
|
|
181
181
|
assert_equal('Object#sub_cycle', method.full_name)
|
182
182
|
assert_equal(1, method.called)
|
183
183
|
assert_in_delta(2, method.total_time, 0.05)
|
184
|
-
assert_in_delta(0, method.self_time, 0.
|
185
|
-
assert_in_delta(0, method.wait_time, 0.
|
184
|
+
assert_in_delta(0, method.self_time, 0.05)
|
185
|
+
assert_in_delta(0, method.wait_time, 0.05)
|
186
186
|
assert_in_delta(2, method.children_time, 0.05)
|
187
187
|
|
188
188
|
assert_equal(1, method.call_infos.length)
|
@@ -198,7 +198,7 @@ class RecursiveTest < Test::Unit::TestCase
|
|
198
198
|
assert_equal('Kernel#sleep', method.full_name)
|
199
199
|
assert_equal(2, method.called)
|
200
200
|
assert_in_delta(2, method.total_time, 0.05)
|
201
|
-
assert_in_delta(2, method.self_time, 0.
|
201
|
+
assert_in_delta(2, method.self_time, 0.05)
|
202
202
|
assert_in_delta(0, method.wait_time, 0.01)
|
203
203
|
assert_in_delta(0, method.children_time, 0.01)
|
204
204
|
|
data/test/stack_test.rb
CHANGED
@@ -53,10 +53,10 @@ class StackTest < Test::Unit::TestCase
|
|
53
53
|
method = methods[0]
|
54
54
|
assert_equal('StackTest#test_call_sequence', method.full_name)
|
55
55
|
assert_equal(1, method.called)
|
56
|
-
assert_in_delta(8, method.total_time, 0.
|
56
|
+
assert_in_delta(8, method.total_time, 0.25)
|
57
57
|
assert_in_delta(0, method.wait_time, 0.01)
|
58
58
|
assert_in_delta(0, method.self_time, 0.01)
|
59
|
-
assert_in_delta(8, method.children_time, 0.
|
59
|
+
assert_in_delta(8, method.children_time, 0.25)
|
60
60
|
assert_equal(1, method.call_infos.length)
|
61
61
|
|
62
62
|
call_info = method.call_infos[0]
|
@@ -83,7 +83,7 @@ class StackTest < Test::Unit::TestCase
|
|
83
83
|
assert_equal(4, method.called)
|
84
84
|
assert_in_delta(8, method.total_time, 0.05)
|
85
85
|
assert_in_delta(0, method.wait_time, 0.01)
|
86
|
-
assert_in_delta(8, method.self_time, 0.
|
86
|
+
assert_in_delta(8, method.self_time, 0.05)
|
87
87
|
assert_in_delta(0, method.children_time, 0.05)
|
88
88
|
assert_equal(4, method.call_infos.length)
|
89
89
|
|
@@ -135,4 +135,4 @@ class StackTest < Test::Unit::TestCase
|
|
135
135
|
assert_equal('StackTest#test_call_sequence->StackClass#a->StackClass#c->StackClass#b', call_info.call_sequence)
|
136
136
|
assert_equal(1, call_info.children.length)
|
137
137
|
end
|
138
|
-
end
|
138
|
+
end
|
data/test/start_stop_test.rb
CHANGED
@@ -43,10 +43,10 @@ class StartStopTest < Test::Unit::TestCase
|
|
43
43
|
method = methods[0]
|
44
44
|
assert_equal('StartStopTest#method1', method.full_name)
|
45
45
|
assert_equal(1, method.called)
|
46
|
-
assert_in_delta(2, method.total_time, 0.
|
46
|
+
assert_in_delta(2, method.total_time, 0.05)
|
47
47
|
assert_in_delta(0, method.wait_time, 0.01)
|
48
48
|
assert_in_delta(0, method.self_time, 0.01)
|
49
|
-
assert_in_delta(2, method.children_time, 0.
|
49
|
+
assert_in_delta(2, method.children_time, 0.05)
|
50
50
|
assert_equal(1, method.call_infos.length)
|
51
51
|
|
52
52
|
call_info = method.call_infos[0]
|
data/test/thread_test.rb
CHANGED
@@ -21,29 +21,27 @@ class ThreadTest < Test::Unit::TestCase
|
|
21
21
|
result = RubyProf.stop
|
22
22
|
assert_equal(2, result.threads.keys.length) # this should pass...
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def test_thread_identity
|
26
26
|
RubyProf.start
|
27
|
-
|
28
27
|
thread = Thread.new do
|
29
|
-
sleep(1)
|
28
|
+
sleep(1)
|
30
29
|
end
|
31
|
-
|
32
30
|
thread.join
|
33
31
|
result = RubyProf.stop
|
34
32
|
|
35
33
|
thread_ids = result.threads.keys.sort
|
36
|
-
threads = [Thread.current, thread]
|
34
|
+
threads = [Thread.current, thread]
|
37
35
|
assert_equal(2, thread_ids.length) # should pass
|
38
36
|
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
assert(thread_ids.include?(threads[0].object_id))
|
38
|
+
assert(thread_ids.include?(threads[1].object_id))
|
39
|
+
|
42
40
|
assert_instance_of(Thread, ObjectSpace._id2ref(thread_ids[0]))
|
43
|
-
|
41
|
+
assert(threads.include? (ObjectSpace._id2ref(thread_ids[0])))
|
44
42
|
|
45
43
|
assert_instance_of(Thread, ObjectSpace._id2ref(thread_ids[1]))
|
46
|
-
|
44
|
+
assert(threads.include?(ObjectSpace._id2ref(thread_ids[1])))
|
47
45
|
end
|
48
46
|
|
49
47
|
def test_thread_timings
|
@@ -64,7 +62,7 @@ class ThreadTest < Test::Unit::TestCase
|
|
64
62
|
assert_equal(1, method.called)
|
65
63
|
assert_in_delta(1, method.total_time, 0.05)
|
66
64
|
assert_in_delta(0, method.self_time, 0.01)
|
67
|
-
assert_in_delta(0, method.wait_time, 0.01)
|
65
|
+
assert_in_delta(0, method.wait_time, 0.01)
|
68
66
|
assert_in_delta(1, method.children_time, 0.01)
|
69
67
|
assert_equal(1, method.call_infos.length)
|
70
68
|
call_info = method.call_infos[0]
|
@@ -159,4 +157,4 @@ class ThreadTest < Test::Unit::TestCase
|
|
159
157
|
end
|
160
158
|
end
|
161
159
|
end
|
162
|
-
end
|
160
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-prof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shugo Maeda and Charlie Savage
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-13 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -53,6 +53,8 @@ files:
|
|
53
53
|
- ext/mingw/build.rake
|
54
54
|
- ext/vc/ruby_prof.sln
|
55
55
|
- ext/vc/ruby_prof.vcproj
|
56
|
+
- lib/out_18
|
57
|
+
- lib/out_19
|
56
58
|
- lib/ruby-prof/abstract_printer.rb
|
57
59
|
- lib/ruby-prof/aggregate_call_info.rb
|
58
60
|
- lib/ruby-prof/call_info.rb
|
@@ -65,8 +67,6 @@ files:
|
|
65
67
|
- lib/ruby-prof/task.rb
|
66
68
|
- lib/ruby-prof/test.rb
|
67
69
|
- lib/ruby-prof.rb
|
68
|
-
- lib/test.rb
|
69
|
-
- lib/test2.rb
|
70
70
|
- lib/unprof.rb
|
71
71
|
- rails/environment/profile.rb
|
72
72
|
- rails/example/example_test.rb
|
data/lib/test.rb
DELETED
data/lib/test2.rb
DELETED