Skip to content

Instantly share code, notes, and snippets.

@Watson1978
Created November 18, 2010 15:39
Show Gist options
  • Select an option

  • Save Watson1978/705140 to your computer and use it in GitHub Desktop.

Select an option

Save Watson1978/705140 to your computer and use it in GitHub Desktop.
filename = ARGV[0]
unless(filename)
puts "usage: #{$0} filename"
exit
end
list = {}
File.open(filename) {|f|
f.each_line do |line|
line.strip!
if (line =~ /^\[DTRACE\](.+)/)
method = $1
list[method] ||= 0
list[method] += 1
end
end
}
list.sort{|a, b| b[1] <=> a[1]}.each do |method, value|
puts "\"#{method}\",#{value}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment