ruby-prof 0.11.3 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +27 -0
- data/README.rdoc +14 -14
- data/bin/ruby-prof +275 -266
- data/ext/ruby_prof/rp_call_info.c +33 -24
- data/ext/ruby_prof/rp_call_info.h +2 -1
- data/ext/ruby_prof/rp_measure.c +1 -1
- data/ext/ruby_prof/rp_measure.h +1 -1
- data/ext/ruby_prof/rp_measure_allocations.c +1 -1
- data/ext/ruby_prof/rp_measure_cpu_time.c +1 -1
- data/ext/ruby_prof/rp_measure_gc_runs.c +1 -1
- data/ext/ruby_prof/rp_measure_gc_time.c +1 -1
- data/ext/ruby_prof/rp_measure_memory.c +1 -1
- data/ext/ruby_prof/rp_measure_process_time.c +2 -2
- data/ext/ruby_prof/rp_measure_wall_time.c +2 -2
- data/ext/ruby_prof/rp_method.c +11 -24
- data/ext/ruby_prof/rp_method.h +2 -3
- data/ext/ruby_prof/rp_stack.c +48 -7
- data/ext/ruby_prof/rp_stack.h +3 -3
- data/ext/ruby_prof/rp_thread.c +26 -17
- data/ext/ruby_prof/rp_thread.h +3 -3
- data/ext/ruby_prof/ruby_prof.c +7 -86
- data/ext/ruby_prof/ruby_prof.h +1 -1
- data/ext/ruby_prof/vc/ruby_prof.sln +12 -6
- data/ext/ruby_prof/vc/ruby_prof_18.vcxproj +110 -0
- data/ext/ruby_prof/vc/{ruby_prof.vcxproj → ruby_prof_19.vcxproj} +4 -1
- data/ext/ruby_prof/vc/ruby_prof_20.vcxproj +112 -0
- data/ext/ruby_prof/version.h +4 -4
- data/lib/ruby-prof.rb +1 -0
- data/lib/ruby-prof/call_info.rb +1 -1
- data/lib/ruby-prof/call_info_visitor.rb +4 -2
- data/lib/ruby-prof/compatibility.rb +6 -1
- data/lib/ruby-prof/method_info.rb +1 -1
- data/lib/ruby-prof/printers/call_info_printer.rb +1 -1
- data/lib/ruby-prof/printers/call_stack_printer.rb +3 -3
- data/lib/ruby-prof/printers/dot_printer.rb +1 -1
- data/lib/ruby-prof/printers/flat_printer.rb +4 -4
- data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +2 -2
- data/lib/ruby-prof/printers/graph_html_printer.rb +3 -3
- data/lib/ruby-prof/printers/graph_printer.rb +15 -15
- data/lib/ruby-prof/thread.rb +22 -0
- data/ruby-prof.gemspec +2 -1
- data/test/basic_test.rb +77 -45
- data/test/call_info_test.rb +78 -0
- data/test/call_info_visitor_test.rb +1 -1
- data/test/dynamic_method_test.rb +14 -8
- data/test/measure_cpu_time_test.rb +23 -12
- data/test/measure_process_time_test.rb +21 -170
- data/test/measure_wall_time_test.rb +59 -13
- data/test/method_elimination_test.rb +30 -19
- data/test/pause_resume_test.rb +129 -22
- data/test/prime.rb +0 -1
- data/test/printers_test.rb +7 -18
- data/test/recursive_test.rb +4 -48
- data/test/test_helper.rb +30 -10
- data/test/test_suite.rb +1 -2
- metadata +23 -5
- data/test/pause_test.rb +0 -57
- data/test/prime_test.rb +0 -13
data/test/test_suite.rb
CHANGED
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.
|
4
|
+
version: 0.12.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: minitest
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
14
30
|
- !ruby/object:Gem::Dependency
|
15
31
|
name: rake-compiler
|
16
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,7 +104,9 @@ files:
|
|
88
104
|
- ext/ruby_prof/ruby_prof.h
|
89
105
|
- ext/ruby_prof/version.h
|
90
106
|
- ext/ruby_prof/vc/ruby_prof.sln
|
91
|
-
- ext/ruby_prof/vc/
|
107
|
+
- ext/ruby_prof/vc/ruby_prof_18.vcxproj
|
108
|
+
- ext/ruby_prof/vc/ruby_prof_19.vcxproj
|
109
|
+
- ext/ruby_prof/vc/ruby_prof_20.vcxproj
|
92
110
|
- lib/ruby-prof.rb
|
93
111
|
- lib/unprof.rb
|
94
112
|
- lib/ruby-prof/aggregate_call_info.rb
|
@@ -100,6 +118,7 @@ files:
|
|
100
118
|
- lib/ruby-prof/rack.rb
|
101
119
|
- lib/ruby-prof/task.rb
|
102
120
|
- lib/ruby-prof/test.rb
|
121
|
+
- lib/ruby-prof/thread.rb
|
103
122
|
- lib/ruby-prof/images/empty.png
|
104
123
|
- lib/ruby-prof/images/minus.png
|
105
124
|
- lib/ruby-prof/images/plus.png
|
@@ -115,6 +134,7 @@ files:
|
|
115
134
|
- lib/ruby-prof/printers/multi_printer.rb
|
116
135
|
- test/aggregate_test.rb
|
117
136
|
- test/basic_test.rb
|
137
|
+
- test/call_info_test.rb
|
118
138
|
- test/call_info_visitor_test.rb
|
119
139
|
- test/duplicate_names_test.rb
|
120
140
|
- test/dynamic_method_test.rb
|
@@ -135,9 +155,7 @@ files:
|
|
135
155
|
- test/multi_printer_test.rb
|
136
156
|
- test/no_method_class_test.rb
|
137
157
|
- test/pause_resume_test.rb
|
138
|
-
- test/pause_test.rb
|
139
158
|
- test/prime.rb
|
140
|
-
- test/prime_test.rb
|
141
159
|
- test/printers_test.rb
|
142
160
|
- test/recursive_test.rb
|
143
161
|
- test/singleton_test.rb
|
data/test/pause_test.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# encoding: UTF-8
|
3
|
-
|
4
|
-
require File.expand_path('../test_helper', __FILE__)
|
5
|
-
|
6
|
-
class PauseTest < 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 test_pause_resume
|
13
|
-
RubyProf.start
|
14
|
-
# Measured
|
15
|
-
RubyProf::C1.hello
|
16
|
-
RubyProf.pause
|
17
|
-
|
18
|
-
# Not measured
|
19
|
-
RubyProf::C1.hello
|
20
|
-
|
21
|
-
RubyProf.resume
|
22
|
-
# Measured
|
23
|
-
RubyProf::C1.hello
|
24
|
-
result = RubyProf.stop
|
25
|
-
|
26
|
-
printer = RubyProf::FlatPrinter.new(result)
|
27
|
-
printer.print
|
28
|
-
|
29
|
-
# Length should be 3:
|
30
|
-
# PauseTest#test_pause_resume
|
31
|
-
# <Class::RubyProf::C1>#hello
|
32
|
-
# Kernel#sleep
|
33
|
-
|
34
|
-
methods = result.threads.first.methods.sort.reverse
|
35
|
-
assert_equal(3, methods.length)
|
36
|
-
|
37
|
-
# Check the names
|
38
|
-
assert_equal('PauseTest#test_pause_resume', methods[0].full_name)
|
39
|
-
assert_equal('<Class::RubyProf::C1>#hello', methods[1].full_name)
|
40
|
-
assert_equal('Kernel#sleep', methods[2].full_name)
|
41
|
-
|
42
|
-
# Check times
|
43
|
-
assert_in_delta(0.3, methods[0].total_time, 0.01)
|
44
|
-
assert_in_delta(0, methods[0].wait_time, 0.01)
|
45
|
-
assert_in_delta(0, methods[0].self_time, 0.01)
|
46
|
-
|
47
|
-
assert_in_delta(0.3, methods[1].total_time, 0.01)
|
48
|
-
assert_in_delta(0, methods[1].wait_time, 0.01)
|
49
|
-
assert_in_delta(0, methods[1].self_time, 0.01)
|
50
|
-
|
51
|
-
assert_in_delta(0.3, methods[2].total_time, 0.01)
|
52
|
-
assert_in_delta(0, methods[2].wait_time, 0.01)
|
53
|
-
assert_in_delta(0.3, methods[2].self_time, 0.01)
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
data/test/prime_test.rb
DELETED