ruby-prof 0.11.2-x86-mingw32 → 0.12.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/CHANGES +27 -0
  2. data/README.rdoc +15 -15
  3. data/Rakefile +5 -0
  4. data/bin/ruby-prof +274 -265
  5. data/ext/ruby_prof/rp_call_info.c +33 -24
  6. data/ext/ruby_prof/rp_call_info.h +2 -1
  7. data/ext/ruby_prof/rp_measure.c +1 -1
  8. data/ext/ruby_prof/rp_measure.h +1 -1
  9. data/ext/ruby_prof/rp_measure_allocations.c +1 -1
  10. data/ext/ruby_prof/rp_measure_cpu_time.c +1 -1
  11. data/ext/ruby_prof/rp_measure_gc_runs.c +1 -1
  12. data/ext/ruby_prof/rp_measure_gc_time.c +1 -1
  13. data/ext/ruby_prof/rp_measure_memory.c +1 -1
  14. data/ext/ruby_prof/rp_measure_process_time.c +2 -2
  15. data/ext/ruby_prof/rp_measure_wall_time.c +2 -2
  16. data/ext/ruby_prof/rp_method.c +11 -24
  17. data/ext/ruby_prof/rp_method.h +2 -3
  18. data/ext/ruby_prof/rp_stack.c +55 -14
  19. data/ext/ruby_prof/rp_stack.h +10 -10
  20. data/ext/ruby_prof/rp_thread.c +30 -21
  21. data/ext/ruby_prof/rp_thread.h +3 -3
  22. data/ext/ruby_prof/ruby_prof.c +9 -88
  23. data/ext/ruby_prof/ruby_prof.h +1 -1
  24. data/ext/ruby_prof/vc/ruby_prof.sln +12 -6
  25. data/ext/ruby_prof/vc/ruby_prof_18.vcxproj +2 -0
  26. data/ext/ruby_prof/vc/{ruby_prof.vcxproj → ruby_prof_19.vcxproj} +4 -1
  27. data/ext/ruby_prof/vc/ruby_prof_20.vcxproj +112 -0
  28. data/ext/ruby_prof/version.h +4 -4
  29. data/lib/1.8/ruby_prof.so +0 -0
  30. data/lib/1.9/ruby_prof.so +0 -0
  31. data/lib/2.0/ruby_prof.so +0 -0
  32. data/lib/ruby-prof.rb +1 -0
  33. data/lib/ruby-prof/call_info.rb +1 -1
  34. data/lib/ruby-prof/call_info_visitor.rb +4 -2
  35. data/lib/ruby-prof/compatibility.rb +13 -3
  36. data/lib/ruby-prof/method_info.rb +1 -1
  37. data/lib/ruby-prof/printers/call_info_printer.rb +1 -1
  38. data/lib/ruby-prof/printers/call_stack_printer.rb +3 -3
  39. data/lib/ruby-prof/printers/dot_printer.rb +2 -2
  40. data/lib/ruby-prof/printers/flat_printer.rb +4 -4
  41. data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +2 -2
  42. data/lib/ruby-prof/printers/graph_html_printer.rb +3 -4
  43. data/lib/ruby-prof/printers/graph_printer.rb +15 -15
  44. data/lib/ruby-prof/profile.rb +1 -1
  45. data/lib/ruby-prof/rack.rb +0 -5
  46. data/lib/ruby-prof/thread.rb +22 -0
  47. data/ruby-prof.gemspec +2 -1
  48. data/test/basic_test.rb +77 -45
  49. data/test/call_info_test.rb +78 -0
  50. data/test/call_info_visitor_test.rb +1 -1
  51. data/test/dynamic_method_test.rb +14 -8
  52. data/test/measure_cpu_time_test.rb +23 -12
  53. data/test/measure_process_time_test.rb +21 -170
  54. data/test/measure_wall_time_test.rb +59 -13
  55. data/test/method_elimination_test.rb +30 -19
  56. data/test/pause_resume_test.rb +129 -22
  57. data/test/prime.rb +1 -2
  58. data/test/printers_test.rb +8 -17
  59. data/test/recursive_test.rb +6 -50
  60. data/test/test_helper.rb +30 -10
  61. data/test/test_suite.rb +1 -2
  62. metadata +23 -7
  63. data/test/bug_test.rb +0 -6
  64. data/test/gc_test.rb +0 -35
  65. data/test/pause_test.rb +0 -57
  66. data/test/prime_test.rb +0 -13
data/test/test_suite.rb CHANGED
@@ -24,8 +24,7 @@ require File.expand_path("../test_helper", __FILE__)
24
24
  module_test
25
25
  multi_printer_test
26
26
  no_method_class_test
27
- pause_test
28
- prime_test
27
+ pause_resume_test
29
28
  printers_test
30
29
  recursive_test
31
30
  singleton_test
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.11.2
4
+ version: 0.12.1
5
5
  prerelease:
6
6
  platform: x86-mingw32
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-06 00:00:00.000000000 Z
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
@@ -87,8 +103,9 @@ files:
87
103
  - ext/ruby_prof/ruby_prof.h
88
104
  - ext/ruby_prof/version.h
89
105
  - ext/ruby_prof/vc/ruby_prof.sln
90
- - ext/ruby_prof/vc/ruby_prof.vcxproj
91
106
  - ext/ruby_prof/vc/ruby_prof_18.vcxproj
107
+ - ext/ruby_prof/vc/ruby_prof_19.vcxproj
108
+ - ext/ruby_prof/vc/ruby_prof_20.vcxproj
92
109
  - lib/ruby-prof.rb
93
110
  - lib/unprof.rb
94
111
  - lib/ruby-prof/aggregate_call_info.rb
@@ -100,6 +117,7 @@ files:
100
117
  - lib/ruby-prof/rack.rb
101
118
  - lib/ruby-prof/task.rb
102
119
  - lib/ruby-prof/test.rb
120
+ - lib/ruby-prof/thread.rb
103
121
  - lib/ruby-prof/images/empty.png
104
122
  - lib/ruby-prof/images/minus.png
105
123
  - lib/ruby-prof/images/plus.png
@@ -115,7 +133,7 @@ files:
115
133
  - lib/ruby-prof/printers/multi_printer.rb
116
134
  - test/aggregate_test.rb
117
135
  - test/basic_test.rb
118
- - test/bug_test.rb
136
+ - test/call_info_test.rb
119
137
  - test/call_info_visitor_test.rb
120
138
  - test/duplicate_names_test.rb
121
139
  - test/dynamic_method_test.rb
@@ -123,7 +141,6 @@ files:
123
141
  - test/exceptions_test.rb
124
142
  - test/exclude_threads_test.rb
125
143
  - test/exec_test.rb
126
- - test/gc_test.rb
127
144
  - test/line_number_test.rb
128
145
  - test/measure_allocations_test.rb
129
146
  - test/measure_cpu_time_test.rb
@@ -137,9 +154,7 @@ files:
137
154
  - test/multi_printer_test.rb
138
155
  - test/no_method_class_test.rb
139
156
  - test/pause_resume_test.rb
140
- - test/pause_test.rb
141
157
  - test/prime.rb
142
- - test/prime_test.rb
143
158
  - test/printers_test.rb
144
159
  - test/recursive_test.rb
145
160
  - test/singleton_test.rb
@@ -152,6 +167,7 @@ files:
152
167
  - test/unique_call_path_test.rb
153
168
  - lib/1.8/ruby_prof.so
154
169
  - lib/1.9/ruby_prof.so
170
+ - lib/2.0/ruby_prof.so
155
171
  homepage: https://github.com/rdp/ruby-prof
156
172
  licenses: []
157
173
  post_install_message:
data/test/bug_test.rb DELETED
@@ -1,6 +0,0 @@
1
- 50000.times do
2
- begin
3
- raise "error"
4
- rescue
5
- end
6
- end
data/test/gc_test.rb DELETED
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
-
4
- require File.expand_path('../test_helper', __FILE__)
5
-
6
- class GcTest < 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 run_profile
13
- RubyProf.profile do
14
- RubyProf::C1.hello
15
- end
16
- end
17
-
18
- def test_gc
19
- result = run_profile
20
-
21
- thread = result.threads.first
22
- method = thread.methods.first
23
- call_info = method.call_infos.first
24
-
25
- result = nil
26
-
27
- 1000.times do
28
- GC.start
29
- Array.new(1000)
30
- end
31
-
32
- puts thread.methods
33
- puts method.full_name
34
- end
35
- end
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.1, 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.1, 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.1, methods[2].total_time, 0.01)
52
- assert_in_delta(0, methods[2].wait_time, 0.01)
53
- assert_in_delta(0.1, methods[2].self_time, 0.01)
54
-
55
- end
56
-
57
- end
data/test/prime_test.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
-
4
- require File.expand_path('../test_helper', __FILE__)
5
-
6
- # -- Tests ----
7
- class PrimeTest< Test::Unit::TestCase
8
- def test_consistency
9
- RubyProf.profile do
10
- run_primes
11
- end
12
- end
13
- end