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.
Files changed (58) hide show
  1. data/CHANGES +27 -0
  2. data/README.rdoc +14 -14
  3. data/bin/ruby-prof +275 -266
  4. data/ext/ruby_prof/rp_call_info.c +33 -24
  5. data/ext/ruby_prof/rp_call_info.h +2 -1
  6. data/ext/ruby_prof/rp_measure.c +1 -1
  7. data/ext/ruby_prof/rp_measure.h +1 -1
  8. data/ext/ruby_prof/rp_measure_allocations.c +1 -1
  9. data/ext/ruby_prof/rp_measure_cpu_time.c +1 -1
  10. data/ext/ruby_prof/rp_measure_gc_runs.c +1 -1
  11. data/ext/ruby_prof/rp_measure_gc_time.c +1 -1
  12. data/ext/ruby_prof/rp_measure_memory.c +1 -1
  13. data/ext/ruby_prof/rp_measure_process_time.c +2 -2
  14. data/ext/ruby_prof/rp_measure_wall_time.c +2 -2
  15. data/ext/ruby_prof/rp_method.c +11 -24
  16. data/ext/ruby_prof/rp_method.h +2 -3
  17. data/ext/ruby_prof/rp_stack.c +48 -7
  18. data/ext/ruby_prof/rp_stack.h +3 -3
  19. data/ext/ruby_prof/rp_thread.c +26 -17
  20. data/ext/ruby_prof/rp_thread.h +3 -3
  21. data/ext/ruby_prof/ruby_prof.c +7 -86
  22. data/ext/ruby_prof/ruby_prof.h +1 -1
  23. data/ext/ruby_prof/vc/ruby_prof.sln +12 -6
  24. data/ext/ruby_prof/vc/ruby_prof_18.vcxproj +110 -0
  25. data/ext/ruby_prof/vc/{ruby_prof.vcxproj → ruby_prof_19.vcxproj} +4 -1
  26. data/ext/ruby_prof/vc/ruby_prof_20.vcxproj +112 -0
  27. data/ext/ruby_prof/version.h +4 -4
  28. data/lib/ruby-prof.rb +1 -0
  29. data/lib/ruby-prof/call_info.rb +1 -1
  30. data/lib/ruby-prof/call_info_visitor.rb +4 -2
  31. data/lib/ruby-prof/compatibility.rb +6 -1
  32. data/lib/ruby-prof/method_info.rb +1 -1
  33. data/lib/ruby-prof/printers/call_info_printer.rb +1 -1
  34. data/lib/ruby-prof/printers/call_stack_printer.rb +3 -3
  35. data/lib/ruby-prof/printers/dot_printer.rb +1 -1
  36. data/lib/ruby-prof/printers/flat_printer.rb +4 -4
  37. data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +2 -2
  38. data/lib/ruby-prof/printers/graph_html_printer.rb +3 -3
  39. data/lib/ruby-prof/printers/graph_printer.rb +15 -15
  40. data/lib/ruby-prof/thread.rb +22 -0
  41. data/ruby-prof.gemspec +2 -1
  42. data/test/basic_test.rb +77 -45
  43. data/test/call_info_test.rb +78 -0
  44. data/test/call_info_visitor_test.rb +1 -1
  45. data/test/dynamic_method_test.rb +14 -8
  46. data/test/measure_cpu_time_test.rb +23 -12
  47. data/test/measure_process_time_test.rb +21 -170
  48. data/test/measure_wall_time_test.rb +59 -13
  49. data/test/method_elimination_test.rb +30 -19
  50. data/test/pause_resume_test.rb +129 -22
  51. data/test/prime.rb +0 -1
  52. data/test/printers_test.rb +7 -18
  53. data/test/recursive_test.rb +4 -48
  54. data/test/test_helper.rb +30 -10
  55. data/test/test_suite.rb +1 -2
  56. metadata +23 -5
  57. data/test/pause_test.rb +0 -57
  58. data/test/prime_test.rb +0 -13
@@ -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.3
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: 2012-12-27 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
@@ -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/ruby_prof.vcxproj
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
@@ -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
@@ -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