Skip to content

Instantly share code, notes, and snippets.

@jaydonnell
Created September 16, 2011 16:53
Show Gist options
  • Save jaydonnell/1222540 to your computer and use it in GitHub Desktop.
Save jaydonnell/1222540 to your computer and use it in GitHub Desktop.
find slow pages in your rails app
# 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