Created
August 1, 2013 03:38
-
-
Save ejoubaud/6128228 to your computer and use it in GitHub Desktop.
Awk for Turtlestein: Sort New Relic queries by pain
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
# In New Relic > Monitoring > Database > Show SQL Trace, | |
# we get a table of slow queries sortable by time spent or by number of occurrences | |
# This allows us to multiply these 2 values to get an actual amount of pain (qty * unit_cost) | |
# Copy/Paste this in Sublime's Shell Turtlestein: | |
| awk -F\t '{ gsub(/[^0-9]/, "", $2); print $2*$3 "\t" $1 }' | sort -nr | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment