首页 > 代码库 > 统计系统每小时平均处理效率
统计系统每小时平均处理效率
日志内容:
2017-03-10 00:01:02 0.0010 - 30 10.12.216.2 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 00:01:02 0.0010 - 30 10.12.218.242 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 00:01:03 0.0010 - 30 10.12.216.1 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 00:01:11 0.0010 - 30 10.12.218.241 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 01:01:22 0.0010 - 30 10.12.216.2 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 01:01:22 0.0 - 30 10.12.218.242 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 01:01:23 0.0 - 30 10.12.216.1 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 01:01:31 0.0010 - 30 10.12.218.241 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 02:01:32 0.182 - 279 10.11.100.136 10.12.216.199:20107 302 POST /purchase_web_01/login /purchase_web_01/login?loginType=login -
2017-03-10 02:01:32 0.0 - 281 10.11.100.136 10.12.216.199:20107 302 GET /purchase_web_01 /purchase_web_01 ‘bMxNYB8cQvfj7ggRvcWtDhL9RcpxctjYYTrZkHhfM9vhFhyrhh2g!-1706772319!1489075292062‘
2017-03-10 02:01:32 0.082 GROUPUSER 2502 10.11.100.136 10.12.216.199:20107 200 GET /purchase_web_01/ /purchase_web_01/ ‘bMxNYB8cQvfj7ggRvcWtDhL9RcpxctjYYTrZkHhfM9vhFhyrhh2g!-1706772319!1489075292062‘
2017-03-10 02:01:32 0.069 GROUPUSER 2502 10.11.100.136 10.12.216.199:20107 200 GET /purchase_web_01/login.do3 /purchase_web_01/login.do3 ‘bMxNYB8cQvfj7ggRvcWtDhL9RcpxctjYYTrZkHhfM9vhFhyrhh2g!-1706772319!1489075292062‘
2017-03-10 03:01:02 0.0010 - 30 10.12.216.2 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 03:01:02 0.0010 - 30 10.12.218.242 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 03:01:03 0.0010 - 30 10.12.216.1 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 03:01:11 0.0010 - 30 10.12.218.241 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 03:01:22 0.0010 - 30 10.12.216.2 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 03:01:22 0.0 - 30 10.12.218.242 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 03:01:23 0.0 - 30 10.12.216.1 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 04:01:31 0.0010 - 30 10.12.218.241 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 04:01:32 0.182 - 279 10.11.100.136 10.12.216.199:20107 302 POST /purchase_web_01/login /purchase_web_01/login?loginType=login -
2017-03-10 04:01:32 0.0 - 281 10.11.100.136 10.12.216.199:20107 302 GET /purchase_web_01 /purchase_web_01 ‘bMxNYB8cQvfj7ggRvcWtDhL9RcpxctjYYTrZkHhfM9vhFhyrhh2g!-1706772319!1489075292062‘
2017-03-10 05:01:32 0.082 GROUPUSER 2502 10.11.100.136 10.12.216.199:20107 200 GET /purchase_web_01/ /purchase_web_01/ ‘bMxNYB8cQvfj7ggRvcWtDhL9RcpxctjYYTrZkHhfM9vhFhyrhh2g!-1706772319!1489075292062‘
2017-03-10 05:01:32 0.069 GROUPUSER 2502 10.11.100.136 10.12.216.199:20107 200 GET /purchase_web_01/login.do3 /purchase_web_01/login.do3 ‘bMxNYB8cQvfj7ggRvcWtDhL9RcpxctjYYTrZkHhfM9vhFhyrhh2g!-1706772319!1489075292062‘
2017-03-10 05:01:02 0.0010 - 30 10.12.216.2 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 05:01:02 0.0010 - 30 10.12.218.242 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 06:01:03 0.0010 - 30 10.12.216.1 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 06:01:11 0.0010 - 30 10.12.218.241 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 07:01:22 0.0010 - 30 10.12.216.2 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 07:01:22 0.0 - 30 10.12.218.242 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 07:01:23 0.0 - 30 10.12.216.1 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 07:01:31 0.0010 - 30 10.12.218.241 10.12.216.199:20107 200 GET /f5monweb/f5check.jsp /f5monweb/f5check.jsp -
2017-03-10 08:01:32 0.182 - 279 10.11.100.136 10.12.216.199:20107 302 POST /purchase_web_01/login /purchase_web_01/login?loginType=login -
2017-03-10 10:01:32 0.0 - 281 10.11.100.136 10.12.216.199:20107 302 GET /purchase_web_01 /purchase_web_01 ‘bMxNYB8cQvfj7ggRvcWtDhL9RcpxctjYYTrZkHhfM9vhFhyrhh2g!-1706772319!1489075292062‘
2017-03-10 10:01:32 0.082 GROUPUSER 2502 10.11.100.136 10.12.216.199:20107 200 GET /purchase_web_01/ /purchase_web_01/ ‘bMxNYB8cQvfj7ggRvcWtDhL9RcpxctjYYTrZkHhfM9vhFhyrhh2g!-1706772319!1489075292062‘
2017-03-10 11:01:32 0.069 GROUPUSER 2502 10.11.100.136 10.12.216.199:20107 200 GET /purchase_web_01/login.do3 /purchase_web_01/login.do3 ‘bMxNYB8cQvfj7ggRvcWtDhL9RcpxctjYYTrZkHhfM9vhFhyrhh2g!-1706772319!1489075292062‘
Tip:
cat log|awk ‘{print $2,$3;split($2,a,":");if(a[1] == b){num[a[1]]++;sum[a[1]]=sum[a[1]]+$3}else{num[a[1]]=1;sum[a[1]]=$3};b=a[1]}END{printf("%-10s%-10s%-10s%-10s\n","HOUR","COUNT","TOTAL","AVERAGE");for(i in num)printf("%-10s%-10s%-10s%-10s\n",i,num[i],sum[i],sum[i]/num[i]);}‘|sort -nk 4
本文出自 “菜鸟也能飞” 博客,请务必保留此出处http://williamwan.blog.51cto.com/10818837/1912117
统计系统每小时平均处理效率