Last active
February 3, 2017 10:17
-
-
Save stamm/8b646c970c87b1b8dbea3b69e915f5f9 to your computer and use it in GitHub Desktop.
Parse goroutines dump (get by kill -6 PID) and group by count of file:line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contents = File.read('goroutines_dump.txt') | |
p = contents.scan(/goroutine\s(\d+).+?^\t(\S+\.go:\d+)/m) | |
counts = Hash.new(0) | |
p.each do |el| | |
counts[el[1]] += 1 | |
end | |
puts counts.sort_by { |k,v| -v } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment