mirror of
https://github.com/github/rails.git
synced 2026-01-08 22:27:59 -05:00
Support an extra profile printer arg
This commit is contained in:
@@ -63,7 +63,9 @@ after = GC.allocated_size
|
|||||||
usage = (after - before) / 1024.0
|
usage = (after - before) / 1024.0
|
||||||
|
|
||||||
if mode
|
if mode
|
||||||
if RubyProf.const_defined?(:CallStackPrinter)
|
if printer = ARGV.shift
|
||||||
|
RubyProf.const_get("#{printer.to_s.classify}Printer").new(results).print($stdout)
|
||||||
|
elsif RubyProf.const_defined?(:CallStackPrinter)
|
||||||
File.open("#{File.basename(path, '.rb')}.#{mode}.html", 'w') do |out|
|
File.open("#{File.basename(path, '.rb')}.#{mode}.html", 'w') do |out|
|
||||||
RubyProf::CallStackPrinter.new(results).print(out)
|
RubyProf::CallStackPrinter.new(results).print(out)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user