Created
January 16, 2016 20:41
-
-
Save toodooleedoo/b4993e693f944e294f60 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
#DATESTRING="20/Oct/2014"; | |
REQUEST_LOG="request.log"; | |
if [ -z "${DATESTRING}" ]; then | |
DATESTRING="`date '+%d/%h/%Y'`"; | |
fi | |
for ((i=0;i<=9;i+=1)); do | |
printf "${DATESTRING} 0${i}: " | |
cat ${REQUEST_LOG} |grep -E "(ms)" |grep "<-" |grep "${DATESTRING}:0${i}" |sed -e 's/.*<-//g;s/.*-//g;s/ms//g;s/text\/html//g;s/.* //g' |awk "NR > 0 { s +=\$1 }; END {print s \" <- TIME TOTAL-> \" NR}" |awk '{print $1/$5}' | |
done; | |
for ((i=10;i<=23;i+=1)); do | |
printf "${DATESTRING} ${i}: " | |
cat ${REQUEST_LOG} |grep -E "(ms)" |grep "<-" |grep "${DATESTRING}:${i}" |sed -e 's/.*<-//g;s/.*-//g;s/ms//g;s/text\/html//g;s/.* //g' |awk "NR > 0 { s +=\$1 }; END {print s \" <- TIME TOTAL-> \" NR}" |awk '{print $1/$5}' | |
done; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment