ruby-prof 0.12.1 → 0.12.2

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 (109) hide show
  1. data/CHANGES +5 -1
  2. data/Rakefile +25 -7
  3. data/bin/ruby-prof +2 -2
  4. data/doc/LICENSE.html +155 -0
  5. data/doc/README_rdoc.html +640 -0
  6. data/doc/Rack.html +167 -0
  7. data/doc/Rack/RubyProf.html +319 -0
  8. data/doc/RubyProf.html +999 -0
  9. data/doc/RubyProf/AbstractPrinter.html +580 -0
  10. data/doc/RubyProf/AggregateCallInfo.html +570 -0
  11. data/doc/RubyProf/CallInfo.html +512 -0
  12. data/doc/RubyProf/CallInfoPrinter.html +190 -0
  13. data/doc/RubyProf/CallInfoVisitor.html +332 -0
  14. data/doc/RubyProf/CallStackPrinter.html +1597 -0
  15. data/doc/RubyProf/CallTreePrinter.html +413 -0
  16. data/doc/RubyProf/Cmd.html +669 -0
  17. data/doc/RubyProf/DotPrinter.html +312 -0
  18. data/doc/RubyProf/FlatPrinter.html +229 -0
  19. data/doc/RubyProf/FlatPrinterWithLineNumbers.html +267 -0
  20. data/doc/RubyProf/GraphHtmlPrinter.html +622 -0
  21. data/doc/RubyProf/GraphPrinter.html +209 -0
  22. data/doc/RubyProf/MethodInfo.html +713 -0
  23. data/doc/RubyProf/MultiPrinter.html +407 -0
  24. data/doc/RubyProf/Profile.html +821 -0
  25. data/doc/RubyProf/ProfileTask.html +532 -0
  26. data/doc/RubyProf/Test.html +578 -0
  27. data/doc/RubyProf/Thread.html +262 -0
  28. data/doc/created.rid +31 -0
  29. data/doc/examples/flat_txt.html +191 -0
  30. data/doc/examples/graph_txt.html +305 -0
  31. data/doc/images/add.png +0 -0
  32. data/doc/images/brick.png +0 -0
  33. data/doc/images/brick_link.png +0 -0
  34. data/doc/images/bug.png +0 -0
  35. data/doc/images/bullet_black.png +0 -0
  36. data/doc/images/bullet_toggle_minus.png +0 -0
  37. data/doc/images/bullet_toggle_plus.png +0 -0
  38. data/doc/images/date.png +0 -0
  39. data/doc/images/delete.png +0 -0
  40. data/doc/images/find.png +0 -0
  41. data/doc/images/loadingAnimation.gif +0 -0
  42. data/doc/images/macFFBgHack.png +0 -0
  43. data/doc/images/package.png +0 -0
  44. data/doc/images/page_green.png +0 -0
  45. data/doc/images/page_white_text.png +0 -0
  46. data/doc/images/page_white_width.png +0 -0
  47. data/doc/images/plugin.png +0 -0
  48. data/doc/images/ruby.png +0 -0
  49. data/doc/images/tag_blue.png +0 -0
  50. data/doc/images/tag_green.png +0 -0
  51. data/doc/images/transparent.png +0 -0
  52. data/doc/images/wrench.png +0 -0
  53. data/doc/images/wrench_orange.png +0 -0
  54. data/doc/images/zoom.png +0 -0
  55. data/doc/index.html +639 -0
  56. data/doc/js/darkfish.js +153 -0
  57. data/doc/js/jquery.js +18 -0
  58. data/doc/js/navigation.js +142 -0
  59. data/doc/js/search.js +94 -0
  60. data/doc/js/search_index.js +1 -0
  61. data/doc/js/searcher.js +228 -0
  62. data/doc/rdoc.css +543 -0
  63. data/doc/table_of_contents.html +462 -0
  64. data/examples/empty.png +0 -0
  65. data/examples/minus.png +0 -0
  66. data/examples/plus.png +0 -0
  67. data/ext/ruby_prof/extconf.rb +5 -1
  68. data/ext/ruby_prof/rp_call_info.c +1 -1
  69. data/ext/ruby_prof/rp_measure_gc_time.c +6 -10
  70. data/ext/ruby_prof/rp_measure_memory.c +0 -1
  71. data/ext/ruby_prof/rp_stack.c +0 -5
  72. data/ext/ruby_prof/vc/ruby_prof_18.vcxproj +0 -2
  73. data/ext/ruby_prof/vc/ruby_prof_19.vcxproj +1 -3
  74. data/ext/ruby_prof/vc/ruby_prof_20.vcxproj +1 -3
  75. data/ext/ruby_prof/version.h +2 -2
  76. data/lib/ruby-prof/compatibility.rb +8 -3
  77. data/lib/ruby-prof/images/empty.png +0 -0
  78. data/lib/ruby-prof/images/minus.png +0 -0
  79. data/lib/ruby-prof/images/plus.png +0 -0
  80. data/lib/ruby-prof/task.rb +0 -0
  81. data/ruby-prof.gemspec +2 -1
  82. data/test/aggregate_test.rb +0 -0
  83. data/test/basic_test.rb +0 -0
  84. data/test/duplicate_names_test.rb +0 -0
  85. data/test/dynamic_method_test.rb +8 -1
  86. data/test/enumerable_test.rb +0 -0
  87. data/test/exceptions_test.rb +0 -0
  88. data/test/exclude_threads_test.rb +0 -0
  89. data/test/exec_test.rb +0 -0
  90. data/test/line_number_test.rb +0 -0
  91. data/test/measure_gc_runs_test.rb +4 -1
  92. data/test/measure_gc_time_test.rb +10 -3
  93. data/test/measure_memory_test.rb +3 -8
  94. data/test/measure_process_time_test.rb +10 -4
  95. data/test/method_elimination_test.rb +1 -2
  96. data/test/module_test.rb +0 -0
  97. data/test/multi_printer_test.rb +5 -6
  98. data/test/no_method_class_test.rb +0 -0
  99. data/test/pause_resume_test.rb +6 -8
  100. data/test/printers_test.rb +0 -0
  101. data/test/recursive_test.rb +0 -0
  102. data/test/singleton_test.rb +0 -0
  103. data/test/stack_printer_test.rb +8 -5
  104. data/test/stack_test.rb +0 -0
  105. data/test/start_stop_test.rb +0 -0
  106. data/test/test_helper.rb +16 -4
  107. data/test/thread_test.rb +0 -0
  108. data/test/unique_call_path_test.rb +0 -0
  109. metadata +90 -17
File without changes
File without changes
File without changes
@@ -2,7 +2,6 @@
2
2
  # encoding: UTF-8
3
3
 
4
4
  require File.expand_path('../test_helper', __FILE__)
5
- require 'tmpdir'
6
5
 
7
6
  # Test data
8
7
  # A
@@ -43,9 +42,10 @@ class StackPrinterTest < Test::Unit::TestCase
43
42
 
44
43
  file_contents = nil
45
44
  assert_nothing_raised { file_contents = print(result) }
46
- assert file_contents =~ /Thread: (\d+) \(100\.00% ~ ([.0-9]+)\)/
45
+ # TODO: why are thread ids negative on travis-ci.org (32 bit build maybe?)
46
+ assert_match(/Thread: (-?\d+) \(100\.00% ~ ([\.0-9]+)\)/, file_contents)
47
47
  actual_time = $2.to_f
48
- assert_in_delta(expected_time, actual_time, 0.01)
48
+ assert_in_delta(expected_time, actual_time, 0.5)
49
49
  end
50
50
 
51
51
  def test_method_elimination
@@ -64,10 +64,13 @@ class StackPrinterTest < Test::Unit::TestCase
64
64
  private
65
65
  def print(result)
66
66
  test = caller.first =~ /in `(.*)'/ ? $1 : "test"
67
- testfile_name = "#{Dir::tmpdir}/ruby_prof_#{test}.html"
67
+ testfile_name = "#{RubyProf.tmpdir}/ruby_prof_#{test}.html"
68
+ # puts "printing to #{testfile_name}"
68
69
  printer = RubyProf::CallStackPrinter.new(result)
69
70
  File.open(testfile_name, "w") {|f| printer.print(f, :threshold => 0, :min_percent => 0, :title => "ruby_prof #{test}")}
70
71
  system("open '#{testfile_name}'") if RUBY_PLATFORM =~ /darwin/ && ENV['SHOW_RUBY_PROF_PRINTER_OUTPUT']=="1"
71
- File.open(testfile_name, "r"){|f| f.read}
72
+ assert File.exist?(testfile_name), "#{testfile_name} does not exist"
73
+ assert File.readable?(testfile_name), "#{testfile_name} is no readable"
74
+ File.read(testfile_name)
72
75
  end
73
76
  end
data/test/stack_test.rb CHANGED
File without changes
File without changes
data/test/test_helper.rb CHANGED
@@ -1,9 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
- # Make ruby 1.8.7 happy
4
- require "rubygems"
5
-
6
3
  # Make RubyMine happy
4
+ require "rubygems"
7
5
  gem "minitest"
8
6
 
9
7
  if ENV["RM_INFO"] || ENV["TEAMCITY_VERSION"]
@@ -98,4 +96,18 @@ module RubyProf
98
96
  def self.ruby_2?
99
97
  ruby_major_version == 2
100
98
  end
101
- end
99
+
100
+ # store printer output in this directory
101
+ def self.tmpdir
102
+ File.expand_path('../../tmp', __FILE__)
103
+ end
104
+ end
105
+
106
+ module MemoryTestHelper
107
+ def memory_test_helper
108
+ result = RubyProf.profile {Array.new}
109
+ total = result.threads.first.methods.inject(0) { |sum, m| sum + m.total_time }
110
+ assert(total < 1_000_000, 'Total should not have subtract overflow error')
111
+ total
112
+ end
113
+ end
data/test/thread_test.rb CHANGED
File without changes
File without changes
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.12.1
4
+ version: 0.12.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,14 +9,14 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-19 00:00:00.000000000 Z
12
+ date: 2013-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ">="
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
22
  type: :development
@@ -24,7 +24,7 @@ dependencies:
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
30
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ">="
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
38
  type: :development
@@ -40,22 +40,32 @@ dependencies:
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - ">="
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
- description: ! 'ruby-prof is a fast code profiler for Ruby. It is a C extension and
47
-
46
+ - !ruby/object:Gem::Dependency
47
+ name: rdoc
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: |
63
+ ruby-prof is a fast code profiler for Ruby. It is a C extension and
48
64
  therefore is many times faster than the standard Ruby profiler. It
49
-
50
65
  supports both flat and graph profiles. For each method, graph profiles
51
-
52
66
  show how long the method ran, which methods called it and which
53
-
54
67
  methods it called. RubyProf generate both text and html and can output
55
-
56
68
  it to standard out or to a file.
57
-
58
- '
59
69
  email: shugo@ruby-lang.org, cfis@savagexi.com, rogerdpack@gmail.com, skaes@railsexpress.de
60
70
  executables:
61
71
  - ruby-prof
@@ -69,6 +79,66 @@ files:
69
79
  - README.rdoc
70
80
  - ruby-prof.gemspec
71
81
  - bin/ruby-prof
82
+ - doc/created.rid
83
+ - doc/examples/flat_txt.html
84
+ - doc/examples/graph_txt.html
85
+ - doc/images/add.png
86
+ - doc/images/brick.png
87
+ - doc/images/brick_link.png
88
+ - doc/images/bug.png
89
+ - doc/images/bullet_black.png
90
+ - doc/images/bullet_toggle_minus.png
91
+ - doc/images/bullet_toggle_plus.png
92
+ - doc/images/date.png
93
+ - doc/images/delete.png
94
+ - doc/images/find.png
95
+ - doc/images/loadingAnimation.gif
96
+ - doc/images/macFFBgHack.png
97
+ - doc/images/package.png
98
+ - doc/images/page_green.png
99
+ - doc/images/page_white_text.png
100
+ - doc/images/page_white_width.png
101
+ - doc/images/plugin.png
102
+ - doc/images/ruby.png
103
+ - doc/images/tag_blue.png
104
+ - doc/images/tag_green.png
105
+ - doc/images/transparent.png
106
+ - doc/images/wrench.png
107
+ - doc/images/wrench_orange.png
108
+ - doc/images/zoom.png
109
+ - doc/index.html
110
+ - doc/js/darkfish.js
111
+ - doc/js/jquery.js
112
+ - doc/js/navigation.js
113
+ - doc/js/search.js
114
+ - doc/js/search_index.js
115
+ - doc/js/searcher.js
116
+ - doc/LICENSE.html
117
+ - doc/Rack/RubyProf.html
118
+ - doc/Rack.html
119
+ - doc/rdoc.css
120
+ - doc/README_rdoc.html
121
+ - doc/RubyProf/AbstractPrinter.html
122
+ - doc/RubyProf/AggregateCallInfo.html
123
+ - doc/RubyProf/CallInfo.html
124
+ - doc/RubyProf/CallInfoPrinter.html
125
+ - doc/RubyProf/CallInfoVisitor.html
126
+ - doc/RubyProf/CallStackPrinter.html
127
+ - doc/RubyProf/CallTreePrinter.html
128
+ - doc/RubyProf/Cmd.html
129
+ - doc/RubyProf/DotPrinter.html
130
+ - doc/RubyProf/FlatPrinter.html
131
+ - doc/RubyProf/FlatPrinterWithLineNumbers.html
132
+ - doc/RubyProf/GraphHtmlPrinter.html
133
+ - doc/RubyProf/GraphPrinter.html
134
+ - doc/RubyProf/MethodInfo.html
135
+ - doc/RubyProf/MultiPrinter.html
136
+ - doc/RubyProf/Profile.html
137
+ - doc/RubyProf/ProfileTask.html
138
+ - doc/RubyProf/Test.html
139
+ - doc/RubyProf/Thread.html
140
+ - doc/RubyProf.html
141
+ - doc/table_of_contents.html
72
142
  - examples/empty.png
73
143
  - examples/flat.txt
74
144
  - examples/graph.dot
@@ -175,18 +245,21 @@ require_paths:
175
245
  required_ruby_version: !ruby/object:Gem::Requirement
176
246
  none: false
177
247
  requirements:
178
- - - ! '>='
248
+ - - ">="
179
249
  - !ruby/object:Gem::Version
180
250
  version: 1.8.7
181
251
  required_rubygems_version: !ruby/object:Gem::Requirement
182
252
  none: false
183
253
  requirements:
184
- - - ! '>='
254
+ - - ">="
185
255
  - !ruby/object:Gem::Version
186
256
  version: '0'
257
+ segments:
258
+ - 0
259
+ hash: -223596189223231347
187
260
  requirements: []
188
261
  rubyforge_project:
189
- rubygems_version: 1.8.24
262
+ rubygems_version: 1.8.25
190
263
  signing_key:
191
264
  specification_version: 3
192
265
  summary: Fast Ruby profiler