ruby-prof 0.14.1 → 0.14.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.
- data/CHANGES +2 -2
- data/Rakefile +9 -5
- data/doc/LICENSE.html +5 -5
- data/doc/README_rdoc.html +43 -46
- data/doc/Rack/RubyProf.html +6 -6
- data/doc/RubyProf/AbstractPrinter.html +1 -1
- data/doc/RubyProf/CallInfo.html +2 -2
- data/doc/RubyProf/CallInfoPrinter.html +1 -1
- data/doc/RubyProf/CallStackPrinter.html +42 -42
- data/doc/RubyProf/CallTreePrinter.html +8 -8
- data/doc/RubyProf/Cmd.html +38 -38
- data/doc/RubyProf/DotPrinter.html +2 -2
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +3 -3
- data/doc/RubyProf/GraphHtmlPrinter.html +3 -3
- data/doc/RubyProf/MethodInfo.html +2 -2
- data/doc/RubyProf/ProfileTask.html +7 -7
- data/doc/RubyProf.html +4 -5
- data/doc/created.rid +2 -2
- data/doc/examples/flat_txt.html +1 -1
- data/doc/examples/graph_txt.html +3 -3
- data/doc/index.html +43 -46
- data/doc/js/search_index.js +1 -1
- data/ext/ruby_prof/extconf.rb +0 -2
- data/ext/ruby_prof/rp_measure_wall_time.c +1 -1
- data/lib/ruby-prof/version.rb +1 -1
- metadata +65 -55
- checksums.yaml +0 -7
- data/doc/RubyProf/Test.html +0 -539
data/CHANGES
CHANGED
data/Rakefile
CHANGED
@@ -75,10 +75,10 @@ RDoc::Task.new("rdoc") do |rdoc|
|
|
75
75
|
rdoc.rdoc_dir = 'doc'
|
76
76
|
rdoc.title = "ruby-prof"
|
77
77
|
# Show source inline with line numbers
|
78
|
-
rdoc.options << "--
|
78
|
+
rdoc.options << "--line-numbers"
|
79
79
|
# Make the readme file the start page for the generated html
|
80
80
|
rdoc.options << '--main' << 'README.rdoc'
|
81
|
-
rdoc.rdoc_files.include('bin
|
81
|
+
rdoc.rdoc_files.include('bin/*',
|
82
82
|
'doc/*.rdoc',
|
83
83
|
'examples/flat.txt',
|
84
84
|
'examples/graph.txt',
|
@@ -92,13 +92,17 @@ end
|
|
92
92
|
|
93
93
|
task :default => :test
|
94
94
|
|
95
|
-
for file in Dir['
|
95
|
+
for file in Dir['lib/**/*.{o,so,bundle}']
|
96
96
|
CLEAN.include file
|
97
97
|
end
|
98
|
-
|
99
|
-
for file in Dir['tmp/*.{txt,dat,png,html}']
|
98
|
+
for file in Dir['doc/**/*.{txt,dat,png,html}']
|
100
99
|
CLEAN.include file
|
101
100
|
end
|
101
|
+
CLEAN.reject!{|f| !File.exist?(f)}
|
102
|
+
task :clean do
|
103
|
+
# remove tmp dir contents completely after cleaning
|
104
|
+
FileUtils.rm_rf('tmp/*')
|
105
|
+
end
|
102
106
|
|
103
107
|
desc 'Run the ruby-prof test suite'
|
104
108
|
Rake::TestTask.new do |t|
|
data/doc/LICENSE.html
CHANGED
@@ -93,11 +93,11 @@ this list of conditions and the following disclaimer in the documentation
|
|
93
93
|
and/or other materials provided with the distribution.</p>
|
94
94
|
</li></ol>
|
95
95
|
|
96
|
-
<p>THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS “AS IS
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
96
|
+
<p>THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS “AS IS” AND ANY
|
97
|
+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
98
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
99
|
+
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
|
100
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
101
101
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
102
102
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
103
103
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
data/doc/README_rdoc.html
CHANGED
@@ -142,8 +142,8 @@ href="README_rdoc.html">README</a>.</p>
|
|
142
142
|
|
143
143
|
<p>ruby-prof requires Ruby 1.9.3 or higher.</p>
|
144
144
|
|
145
|
-
<p>If you are running Linux or Unix you
|
146
|
-
|
145
|
+
<p>If you are running Linux or Unix you’ll need a C compiler so the extension
|
146
|
+
can be compiled when it is installed.</p>
|
147
147
|
|
148
148
|
<p>If you are running Windows, then you may need to install the Windows
|
149
149
|
specific RubyGem which includes an already built extension (see Install
|
@@ -155,8 +155,8 @@ section).</p>
|
|
155
155
|
|
156
156
|
<pre>gem install ruby-prof</pre>
|
157
157
|
|
158
|
-
<p>If you
|
159
|
-
|
158
|
+
<p>If you’re on windows then a prebuilt binary gem is available. You may of
|
159
|
+
course compile it yourself via use of devkit on MinGW.</p>
|
160
160
|
|
161
161
|
<h2 id="label-Usage">Usage<span><a href="#label-Usage">¶</a> <a href="#documentation">↑</a></span></h2>
|
162
162
|
|
@@ -173,7 +173,7 @@ For more information refer to the documentation of the ruby-prof command.</p>
|
|
173
173
|
<p>The second way is to use the ruby-prof API to profile particular segments
|
174
174
|
of code.</p>
|
175
175
|
|
176
|
-
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string"
|
176
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'ruby-prof'</span>
|
177
177
|
|
178
178
|
<span class="ruby-comment"># Profile the code</span>
|
179
179
|
<span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">start</span>
|
@@ -189,7 +189,7 @@ of code.</p>
|
|
189
189
|
|
190
190
|
<p>Alternatively, you can use a block to tell ruby-prof what to profile:</p>
|
191
191
|
|
192
|
-
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string"
|
192
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'ruby-prof'</span>
|
193
193
|
|
194
194
|
<span class="ruby-comment"># Profile the code</span>
|
195
195
|
<span class="ruby-identifier">result</span> = <span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">profile</span> <span class="ruby-keyword">do</span>
|
@@ -205,7 +205,7 @@ of code.</p>
|
|
205
205
|
|
206
206
|
<p>ruby-prof also supports pausing and resuming profiling runs.</p>
|
207
207
|
|
208
|
-
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string"
|
208
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'ruby-prof'</span>
|
209
209
|
|
210
210
|
<span class="ruby-comment"># Profile the code</span>
|
211
211
|
<span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">start</span>
|
@@ -220,7 +220,7 @@ of code.</p>
|
|
220
220
|
<p>Note that resume will automatically call start if a profiling run has not
|
221
221
|
yet started. In addition, resume can also take a block:</p>
|
222
222
|
|
223
|
-
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string"
|
223
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'ruby-prof'</span>
|
224
224
|
|
225
225
|
<span class="ruby-comment"># Profile the code</span>
|
226
226
|
<span class="ruby-constant">RubyProf</span>.<span class="ruby-identifier">resume</span> <span class="ruby-keyword">do</span>
|
@@ -240,10 +240,10 @@ results. This is useful for reducing connectivity in the call graph, making
|
|
240
240
|
it easier to identify the source of performance problems when using a graph
|
241
241
|
printer.</p>
|
242
242
|
|
243
|
-
<p>For example, consider Integer#times: it
|
244
|
-
|
245
|
-
|
246
|
-
|
243
|
+
<p>For example, consider Integer#times: it’s hardly ever useful to know how
|
244
|
+
much time is spent in the method itself. We’re much more interested in how
|
245
|
+
much the passed in block contributes to the time spent in the method which
|
246
|
+
contains the Integer#times call.</p>
|
247
247
|
|
248
248
|
<p>Methods are eliminated from the collected data by calling
|
249
249
|
`eliminate_methods!` on the profiling result, before submitting it to a
|
@@ -270,10 +270,9 @@ profiling.</p>
|
|
270
270
|
|
271
271
|
<h2 id="label-Benchmarking+full+load+time+including+rubygems+startup+cost+%3D%3D">Benchmarking full load time including rubygems startup cost ==<span><a href="#label-Benchmarking+full+load+time+including+rubygems+startup+cost+%3D%3D">¶</a> <a href="#documentation">↑</a></span></h2>
|
272
272
|
|
273
|
-
<p>If you want to get a more accurate measurement of what takes all of a
|
274
|
-
|
275
|
-
|
276
|
-
bin/ruby-prof directly, ex:</p>
|
273
|
+
<p>If you want to get a more accurate measurement of what takes all of a gem’s
|
274
|
+
bin/xxx command to load, you may want to also measure rubygems’ startup
|
275
|
+
penalty. You can do this by calling into bin/ruby-prof directly, ex:</p>
|
277
276
|
|
278
277
|
<p>$ gem which ruby-prof</p>
|
279
278
|
|
@@ -291,28 +290,26 @@ g:192binsome_installed_gem_command</p>
|
|
291
290
|
|
292
291
|
<h2 id="label-Profiling+Tests">Profiling Tests<span><a href="#label-Profiling+Tests">¶</a> <a href="#documentation">↑</a></span></h2>
|
293
292
|
|
294
|
-
<p>ruby-prof supports profiling tests cases written using Ruby
|
295
|
-
|
296
|
-
|
297
|
-
class:</p>
|
293
|
+
<p>ruby-prof supports profiling tests cases written using Ruby’s built-in unit
|
294
|
+
test framework (ie, test derived from Test::Unit::TestCase). To enable
|
295
|
+
profiling simply add the following line of code to within your test class:</p>
|
298
296
|
|
299
297
|
<pre>include RubyProf::Test</pre>
|
300
298
|
|
301
299
|
<p>Each test method is profiled separately. ruby-prof will run each test
|
302
300
|
method once as a warmup and then ten additional times to gather profile
|
303
301
|
data. Note that the profile data will <strong>not</strong> include the
|
304
|
-
class
|
302
|
+
class’s setup or teardown methods.</p>
|
305
303
|
|
306
304
|
<p>Separate reports are generated for each method and saved, by default, in
|
307
|
-
the test process
|
308
|
-
|
309
|
-
|
310
|
-
RubyProf::Test::PROFILE_OPTIONS.</p>
|
305
|
+
the test process’s working directory. To change this, or other profiling
|
306
|
+
options, modify your test class’s PROFILE_OPTIONS hash table. To globally
|
307
|
+
change test profiling options, modify RubyProf::Test::PROFILE_OPTIONS.</p>
|
311
308
|
|
312
309
|
<h2 id="label-Profiling+Rails">Profiling Rails<span><a href="#label-Profiling+Rails">¶</a> <a href="#documentation">↑</a></span></h2>
|
313
310
|
|
314
311
|
<p>To profile a Rails application it is vital to run it using production like
|
315
|
-
settings (cache classes, cache view lookups, etc.). Otherwise, Rail
|
312
|
+
settings (cache classes, cache view lookups, etc.). Otherwise, Rail’s
|
316
313
|
dependency loading code will overwhelm any time spent in the application
|
317
314
|
itself (our tests show that Rails dependency loading causes a roughly 6x
|
318
315
|
slowdown). The best way to do this is create a new Rails environment,
|
@@ -328,14 +325,14 @@ likely turn off caching.</p>
|
|
328
325
|
<p>Add the ruby-prof to your gemfile:</p>
|
329
326
|
|
330
327
|
<pre>group :profile do
|
331
|
-
gem
|
328
|
+
gem 'ruby-prof'
|
332
329
|
end</pre>
|
333
330
|
</li><li>
|
334
331
|
<p>Add the ruby prof rack adapter to your middleware stack. One way to do
|
335
332
|
this is by adding the following code to config.ru:</p>
|
336
333
|
|
337
334
|
<pre class="ruby"><span class="ruby-keyword">if</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">env</span>.<span class="ruby-identifier">profile?</span>
|
338
|
-
<span class="ruby-identifier">use</span> <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span>, :<span class="ruby-identifier">path</span> =<span class="ruby-operator">></span> <span class="ruby-string"
|
335
|
+
<span class="ruby-identifier">use</span> <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span>, :<span class="ruby-identifier">path</span> =<span class="ruby-operator">></span> <span class="ruby-string">'/temp/profile'</span>
|
339
336
|
<span class="ruby-keyword">end</span>
|
340
337
|
</pre>
|
341
338
|
|
@@ -397,7 +394,7 @@ href="http://github.com/ruby-prof/ruby-prof/tree/master/examples/call_stack.html
|
|
397
394
|
<p>Another good example: [<a
|
398
395
|
href="http://twitpic.com/28z94a">twitpic.com/28z94a</a>]</p>
|
399
396
|
|
400
|
-
<p>Finally, there
|
397
|
+
<p>Finally, there’s a so called MultiPrinter which can generate several
|
401
398
|
reports in one profiling run. See <a
|
402
399
|
href="http://github.com/ruby-prof/ruby-prof/tree/master/examples/multi.stack.html">examples/multi.stack.html</a>.</p>
|
403
400
|
|
@@ -421,7 +418,7 @@ call graph report in text format</p>
|
|
421
418
|
Creates a call graph report in HTML (separate files per thread)</p>
|
422
419
|
</li><li>
|
423
420
|
<p><a href="RubyProf/DotPrinter.html">RubyProf::DotPrinter</a> - Creates a
|
424
|
-
call graph report in GraphViz
|
421
|
+
call graph report in GraphViz's DOT format which can be converted to an
|
425
422
|
image</p>
|
426
423
|
</li><li>
|
427
424
|
<p><a href="RubyProf/CallTreePrinter.html">RubyProf::CallTreePrinter</a> -
|
@@ -491,8 +488,8 @@ significant CPU or disk time during a profiling run then the reported
|
|
491
488
|
results will be too large.</p>
|
492
489
|
|
493
490
|
<p>CPU time uses the CPU clock counter to measure time. The returned values
|
494
|
-
are dependent on the correctly setting the CPU
|
495
|
-
|
491
|
+
are dependent on the correctly setting the CPU’s frequency. This mode is
|
492
|
+
only supported on Pentium or PowerPC platforms (linux only).</p>
|
496
493
|
|
497
494
|
<p>Object allocation reports show how many objects each method in a program
|
498
495
|
allocates. This support was added by Sylvain Joyeux and requires a patched
|
@@ -504,16 +501,16 @@ This support was added by Alexander Dymo and requires a patched Ruby
|
|
504
501
|
interpreter. For more information, see: <a
|
505
502
|
href="http://rubyforge.org/tracker/index.php?func=detail&aid=17676&group_id=1814&atid=7062">rubyforge.org/tracker/index.php?func=detail&aid=17676&group_id=1814&atid=7062</a></p>
|
506
503
|
|
507
|
-
<p>Garbage collection runs report how many times Ruby
|
508
|
-
|
504
|
+
<p>Garbage collection runs report how many times Ruby’s garbage collector is
|
505
|
+
invoked during a profiling session. This support was added by Jeremy
|
509
506
|
Kemper and requires a patched Ruby interpreter. For more information, see:
|
510
507
|
<a
|
511
508
|
href="http://rubyforge.org/tracker/index.php?func=detail&aid=17676&group_id=1814&atid=7062">rubyforge.org/tracker/index.php?func=detail&aid=17676&group_id=1814&atid=7062</a></p>
|
512
509
|
|
513
|
-
<p>Garbage collection time reports how much time is spent in Ruby
|
514
|
-
|
515
|
-
|
516
|
-
|
510
|
+
<p>Garbage collection time reports how much time is spent in Ruby’s garbage
|
511
|
+
collector during a profiling session. This support was added by Jeremy
|
512
|
+
Kemper and requires a patched Ruby interpreter. For more information, see:
|
513
|
+
<a
|
517
514
|
href="http://rubyforge.org/tracker/index.php?func=detail&aid=17676&group_id=1814&atid=7062">rubyforge.org/tracker/index.php?func=detail&aid=17676&group_id=1814&atid=7062</a></p>
|
518
515
|
|
519
516
|
<p>To set the measurement:</p>
|
@@ -580,7 +577,7 @@ profiling run and is otherwise quiescent.</p>
|
|
580
577
|
|
581
578
|
<p>On both platforms, cpu time is measured using the RDTSC assembly function
|
582
579
|
provided by the Pentium and PowerPC platforms. CPU time is dependent on the
|
583
|
-
cpu
|
580
|
+
cpu’s frequency. On Linux, ruby-prof attempts to read this value from
|
584
581
|
“/proc/cpuinfo.” On Windows, you must manually specify the clock
|
585
582
|
frequency. This can be done using the RUBY_PROF_CPU_FREQUENCY environment
|
586
583
|
variable:</p>
|
@@ -597,18 +594,18 @@ variable:</p>
|
|
597
594
|
context switches in 1.8. As a result, the timings ruby-prof reports for
|
598
595
|
each thread may be slightly inaccurate. In particular, this will happen
|
599
596
|
for newly spawned threads that go to sleep immediately (their first call).
|
600
|
-
For instance, if you use Ruby
|
601
|
-
|
597
|
+
For instance, if you use Ruby’s timeout library to wait for 2 seconds, the
|
598
|
+
2 seconds will be assigned to the foreground thread and not the newly
|
602
599
|
created background thread. These errors can largely be avoided if the
|
603
600
|
background thread performs any operation before going to sleep.</p>
|
604
601
|
|
605
602
|
<h2 id="label-Performance">Performance<span><a href="#label-Performance">¶</a> <a href="#documentation">↑</a></span></h2>
|
606
603
|
|
607
|
-
<p>Significant effort has been put into reducing ruby-prof
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
604
|
+
<p>Significant effort has been put into reducing ruby-prof’s overhead as much
|
605
|
+
as possible. Our tests show that the overhead associated with profiling
|
606
|
+
code varies considerably with the code being profiled. Most programs will
|
607
|
+
run approximately twice as slow while highly recursive programs (like the
|
608
|
+
fibonacci series test) will run three times slower.</p>
|
612
609
|
|
613
610
|
<h2 id="label-License">License<span><a href="#label-License">¶</a> <a href="#documentation">↑</a></span></h2>
|
614
611
|
|
data/doc/Rack/RubyProf.html
CHANGED
@@ -138,10 +138,10 @@
|
|
138
138
|
<span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
|
139
139
|
<span class="ruby-ivar">@options</span>[<span class="ruby-value">:min_percent</span>] <span class="ruby-operator">||=</span> <span class="ruby-value">1</span>
|
140
140
|
<span class="ruby-ivar">@tmpdir</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>
|
141
|
-
<span class="ruby-ivar">@printer_klasses</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value">:printers</span>] <span class="ruby-operator">||</span> {<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">FlatPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string"
|
142
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string"
|
143
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphHtmlPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string"
|
144
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">CallStackPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string"
|
141
|
+
<span class="ruby-ivar">@printer_klasses</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value">:printers</span>] <span class="ruby-operator">||</span> {<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">FlatPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'flat.txt'</span>,
|
142
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'graph.txt'</span>,
|
143
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphHtmlPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'graph.html'</span>,
|
144
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">CallStackPrinter</span> =<span class="ruby-operator">></span> <span class="ruby-string">'call_stack.html'</span>}
|
145
145
|
|
146
146
|
<span class="ruby-ivar">@skip_paths</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:skip_paths</span>] <span class="ruby-operator">||</span> [<span class="ruby-regexp">%r{^/assets}</span>, <span class="ruby-regexp">%r{\.css$}</span>, <span class="ruby-regexp">%r{\.js$}</span>, <span class="ruby-regexp">%r{\.png$}</span>, <span class="ruby-regexp">%r{\.jpeg$}</span>, <span class="ruby-regexp">%r{\.jpg$}</span>, <span class="ruby-regexp">%r{\.gif$}</span>]
|
147
147
|
<span class="ruby-keyword">end</span></pre>
|
@@ -194,7 +194,7 @@
|
|
194
194
|
<span class="ruby-identifier">result</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
195
195
|
<span class="ruby-keyword">end</span>
|
196
196
|
|
197
|
-
<span class="ruby-identifier">path</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string"
|
197
|
+
<span class="ruby-identifier">path</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'/'</span>, <span class="ruby-string">'-'</span>)
|
198
198
|
<span class="ruby-identifier">path</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>)
|
199
199
|
|
200
200
|
<span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>)
|
@@ -235,7 +235,7 @@
|
|
235
235
|
<span class="ruby-ivar">@printer_klasses</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">printer_klass</span>, <span class="ruby-identifier">base_name</span><span class="ruby-operator">|</span>
|
236
236
|
<span class="ruby-identifier">printer</span> = <span class="ruby-identifier">printer_klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">data</span>)
|
237
237
|
<span class="ruby-identifier">file_name</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@tmpdir</span>, <span class="ruby-node">"#{path}-#{base_name}"</span>)
|
238
|
-
<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file_name</span>, <span class="ruby-string"
|
238
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file_name</span>, <span class="ruby-string">'wb'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
239
239
|
<span class="ruby-identifier">printer</span>.<span class="ruby-identifier">print</span>(<span class="ruby-identifier">file</span>, <span class="ruby-ivar">@options</span>)
|
240
240
|
<span class="ruby-keyword">end</span>
|
241
241
|
<span class="ruby-keyword">end</span>
|
@@ -476,7 +476,7 @@ options.</p>
|
|
476
476
|
for it to be printed out in the report.
|
477
477
|
Default value is 0.
|
478
478
|
|
479
|
-
:print_file - True or false. Specifies if a method
|
479
|
+
:print_file - True or false. Specifies if a method's source
|
480
480
|
file should be printed. Default value if false.
|
481
481
|
|
482
482
|
:sort_method - Specifies method used for sorting method infos.
|
data/doc/RubyProf/CallInfo.html
CHANGED
@@ -166,7 +166,7 @@
|
|
166
166
|
<pre><span class="ruby-comment"># File lib/ruby-prof/call_info.rb, line 25</span>
|
167
167
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">call_sequence</span>
|
168
168
|
<span class="ruby-ivar">@call_sequence</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
|
169
|
-
<span class="ruby-identifier">stack</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">method</span><span class="ruby-operator">|</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>}.<span class="ruby-identifier">join</span>(<span class="ruby-string"
|
169
|
+
<span class="ruby-identifier">stack</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">method</span><span class="ruby-operator">|</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>}.<span class="ruby-identifier">join</span>(<span class="ruby-string">'->'</span>)
|
170
170
|
<span class="ruby-keyword">end</span>
|
171
171
|
<span class="ruby-keyword">end</span></pre>
|
172
172
|
</div>
|
@@ -276,7 +276,7 @@ from both praent end self.</p>
|
|
276
276
|
<div class="method-description">
|
277
277
|
|
278
278
|
<p>find a specific call in list of children. returns nil if not found. note:
|
279
|
-
there can
|
279
|
+
there can’t be more than one child with a given target method. in other
|
280
280
|
words: x.children.grep{|y|y.target==m}.size <= 1 for all method infos m
|
281
281
|
and call infos x</p>
|
282
282
|
|