Last active
August 29, 2015 13:57
-
-
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
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
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