Created
September 16, 2011 16:53
-
-
Save jaydonnell/1222540 to your computer and use it in GitHub Desktop.
find slow pages in your rails app
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
# usage: cat log/production.log | grep Completed | ruby slow_pages.rb | |
ARGF.each_line do |line| | |
fields = line.split(' ') | |
total = fields[4].to_f / 1000.0 | |
ar = fields[9].to_f / 1000.0 | |
if total > 1 | |
puts "total: #{total} AR: #{ar}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment