Class: PluginTool::ProfilerFormatterTree

Inherits:
ProfilerFormatter show all
Defined in:
lib/debuggers.rb

Instance Method Summary collapse

Methods inherited from ProfilerFormatter

#format, #initialize

Constructor Details

This class inherits a constructor from PluginTool::ProfilerFormatter

Instance Method Details

#_format(report, output_file) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/debuggers.rb', line 63

def _format(report, output_file)
  report.split("\n").each do |line|
    depth, time, percent, count, position = line.split("\t")
    if depth == 'REPORT'
      output_file.write("PROFILE -- #{Time.new(time)}\n")
    elsif depth == 'OMIT'
      output_file.write(("  "*time.to_i)+"... children omitted\n")
    else
      output_file.write(("  "*depth.to_i)+"#{percent} #{count} #{time.to_i / 1000000} #{position}\n")
    end
  end
end