Created
December 2, 2008 17:52
-
-
Save tomlea/31197 to your computer and use it in GitHub Desktop.
Script to parse rails logs and summarise total partial rendering times.
This file contains 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
data = Hash.new(0) | |
while line = gets | |
if m = line.match(/Rendered (\S+) \(([\d\.]+)\)/) | |
data[m[1]] += m[2].to_f | |
end | |
if line =~ /Completed/ | |
data.sort_by{ |name, value| value }.each do |name, value| | |
puts "%.04f : #{name}" % value | |
end | |
puts line, "" | |
data.clear | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment