tomcatの平均レスポンスタイムを集計するワンライナー

More than 3 years have passed since last update.

個人的メモ

grep hegehoge/upload /var/log/tomcat/access_log.20150316 | cut -d'"' -f7 | sort -nr | head -n 1000 | awk '{m+=$1} END{print m/NR;}'

Tomcatのログ出力は下記Valveを前提。

<Valve className="org.apache.catalina.valves.AccessLogValve"

directory="/var/log/tomcat"
fileDateFormat="yyyyMMdd"
prefix="access_log."
suffix=""
pattern='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i" %D'
/>