lib/ruby-prof/printers/dot_printer.rb in ruby-prof-1.1.0 vs lib/ruby-prof/printers/dot_printer.rb in ruby-prof-1.2.0

- old
+ new

@@ -112,15 +112,15 @@ end end end def print_edges(total_time, method) - method.callers.sort_by(&:total_time).reverse.each do |call_info| - target_percentage = (call_info.target.total_time / total_time) * 100.0 + method.call_trees.callers.sort_by(&:total_time).reverse.each do |call_tree| + target_percentage = (call_tree.target.total_time / total_time) * 100.0 next if target_percentage < min_percent # Get children method - puts "#{dot_id(method)} -> #{dot_id(call_info.target)} [label=\"#{call_info.called}/#{call_info.target.called}\" fontsize=10 fontcolor=#{EDGE_COLOR}];" + puts "#{dot_id(method)} -> #{dot_id(call_tree.target)} [label=\"#{call_tree.called}/#{call_tree.target.called}\" fontsize=10 fontcolor=#{EDGE_COLOR}];" end end # Silly little helper for printing to the @output def puts(str)