Created
October 9, 2008 15:52
-
-
Save da3mon/15802 to your computer and use it in GitHub Desktop.
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
#usage: zsr _m_ _n_ : sowest _n_ requests from gzipped log file _m_ | |
function zsr () { | |
zgrep ' (0 reqs/sec) ' $1| | |
awk '{ print $8 " - Mongrel:" $13", " $14 " DB:" $17", "$18 " " $22 }' | | |
sort -nr|head -n $2; | |
} | |
#usage: sr _m_ _n_ : sowest _n_ requests from log file _m_ | |
function sr () { | |
grep ' (0 reqs/sec) ' $1| | |
awk '{ print $8 " - Mongrel:" $13", " $14 " DB:" $17", "$18 " " $22 }' | | |
sort -nr|head -n $2; | |
} | |
#histogram of most frequently hit urls | |
zgrep ': Completed ' production-combined.log-20081008.gz|awk '{ print $NF }'|sort|uniq -ci|sort -nr|head -n 100 | |
#url access times, slowest first | |
zgrep ' Completed.*http://site/route' production-combined.log-20081008.gz|awk '{ print $8 " erb:" $13 " db:" $17 " url:" $NF }'|sort -nr | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment