mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Support an extra profile printer arg
This commit is contained in:
parent
7b730a2f1b
commit
4883082ff1
1 changed files with 3 additions and 1 deletions
|
@ -63,7 +63,9 @@ after = GC.allocated_size
|
|||
usage = (after - before) / 1024.0
|
||||
|
||||
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|
|
||||
RubyProf::CallStackPrinter.new(results).print(out)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue