Skip to content

Instantly share code, notes, and snippets.

@miguelff
Last active August 29, 2015 13:57
Show Gist options
  • Save miguelff/9545730 to your computer and use it in GitHub Desktop.
Save miguelff/9545730 to your computer and use it in GitHub Desktop.
Grep the times spent by non-cached SQL queries from a log, you can the count it and sum it to get aggregate results of the queries done and the time spent by them
cat log/development.log|grep SELECT |grep -v CACHE | ruby -e "ARGF.each{|line| puts line.match(/(\d+\.\d+)ms/).captures rescue nil}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment