Skip to content

Instantly share code, notes, and snippets.

@ejoubaud
Created August 1, 2013 03:38
Show Gist options
  • Save ejoubaud/6128228 to your computer and use it in GitHub Desktop.
Save ejoubaud/6128228 to your computer and use it in GitHub Desktop.
Awk for Turtlestein: Sort New Relic queries by pain
# 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