-
分析文档内容如下第一个文档名称
com1_115200_2020-03-05_11-39-23_100s.log
内容如下
cpuinfo:total:75.0,u:54.0,s:18.0,io:0.0,idle:25.0
cpuinfo:total:78.0,u:54.0,s:21.0,io:0.0,idle:22.0
cpuinfo:total:63.6,u:41.4,s:20.2,io:0.0,idle:36.4
cpuinfo:total:71.7,u:48.5,s:20.2,io:0.0,idle:28.3
cpuinfo:total:75.0,u:54.0,s:18.0,io:0.0,idle:25.0
cpuinfo:total:78.0,u:54.0,s:21.0,io:0.0,idle:22.0
cpuinfo:total:63.6,u:41.4,s:20.2,io:0.0,idle:36.4
cpuinfo:total:71.7,u:48.5,s:20.2,io:0.0,idle:28.3
等等,大概有900多条数据
-
分析文档第二个文档名称
192.168.184.128_2020-03-05_11-27-05_100s.log
内容如下
test start== 1583379145408
main: no process found
start jmeter test pid=25115
end jmeter test pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =197 pid=25115
not write db process num =194 pid=25115
not write db process num =183 pid=25115
not write db process num =172 pid=25115
not write db process num =161 pid=25115
not write db process num =154 pid=25115
not write db process num =141 pid=25115
not write db process num =131 pid=25115
not write db process num =121 pid=25115
not write db process num =106 pid=25115
not write db process num =95 pid=25115
not write db process num =86 pid=25115
not write db process num =81 pid=25115
not write db process num =73 pid=25115
not write db process num =66 pid=25115
not write db process num =56 pid=25115
not write db process num =45 pid=25115
not write db process num =35 pid=25115
not write db process num =20 pid=25115
not write db process num =11 pid=25115
not write db process num =3 pid=25115
SUCCESS write db finish pid=25115
test end === 1583379286475 consume == 141067 counter== 1
test start== 1583379145408
main: no process found
start jmeter test pid=25115
end jmeter test pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =197 pid=25115
not write db process num =194 pid=25115
not write db process num =183 pid=25115
not write db process num =172 pid=25115
not write db process num =161 pid=25115
not write db process num =154 pid=25115
not write db process num =141 pid=25115
not write db process num =131 pid=25115
not write db process num =121 pid=25115
not write db process num =106 pid=25115
not write db process num =95 pid=25115
not write db process num =86 pid=25115
not write db process num =81 pid=25115
not write db process num =73 pid=25115
not write db process num =66 pid=25115
not write db process num =56 pid=25115
not write db process num =45 pid=25115
not write db process num =35 pid=25115
not write db process num =20 pid=25115
not write db process num =11 pid=25115
not write db process num =3 pid=25115
SUCCESS write db finish pid=25115
test end === 1583379286475 consume == 141067 counter== 2
test start== 1583379145408
main: no process found
start jmeter test pid=25115
end jmeter test pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =197 pid=25115
not write db process num =194 pid=25115
not write db process num =183 pid=25115
not write db process num =172 pid=25115
not write db process num =161 pid=25115
not write db process num =154 pid=25115
not write db process num =141 pid=25115
not write db process num =131 pid=25115
not write db process num =121 pid=25115
not write db process num =106 pid=25115
not write db process num =95 pid=25115
not write db process num =86 pid=25115
not write db process num =81 pid=25115
not write db process num =73 pid=25115
not write db process num =66 pid=25115
not write db process num =56 pid=25115
not write db process num =45 pid=25115
not write db process num =35 pid=25115
not write db process num =20 pid=25115
not write db process num =11 pid=25115
not write db process num =3 pid=25115
SUCCESS write db finish pid=25115
test end === 1583379286475 consume == 141067 counter== 3
test start== 1583379145408
main: no process found
start jmeter test pid=25115
end jmeter test pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =202 pid=25115
not write db process num =197 pid=25115
not write db process num =194 pid=25115
not write db process num =183 pid=25115
not write db process num =172 pid=25115
not write db process num =161 pid=25115
not write db process num =154 pid=25115
not write db process num =141 pid=25115
not write db process num =131 pid=25115
not write db process num =121 pid=25115
not write db process num =106 pid=25115
not write db process num =95 pid=25115
not write db process num =86 pid=25115
not write db process num =81 pid=25115
not write db process num =73 pid=25115
not write db process num =66 pid=25115
not write db process num =56 pid=25115
not write db process num =45 pid=25115
not write db process num =35 pid=25115
not write db process num =20 pid=25115
not write db process num =11 pid=25115
not write db process num =3 pid=25115
SUCCESS write db finish pid=25115
test end === 1583379286475 consume == 141067 counter== 4
大概有26条
-
分析脚本如下
#/bin/sh
base80="80.0"
base85="85.0"
base80_counter=0
base85_counter=0
num=`cat $1 |grep "cpuinfo"|awk -F ':' '{print $4}'|awk -F ',' '{print $1}'|sort -n|wc -l`
echo $num
data=`cat $1 |grep "cpuinfo"|awk -F ':' '{print $4}'|awk -F ',' '{print $1}'|sort -n|tail -100`
base80_counter=`cat $1 |grep "cpuinfo"|awk -F ':' '{print $4}'|awk -F ',' '{print $1}'|awk '$1 > 80 { print $0 ;}'|wc -l`
base85_counter=`cat $1 |grep "cpuinfo"|awk -F ':' '{print $4}'|awk -F ',' '{print $1}'|awk '$1 > 85 { print $0 ;}'|wc -l`
echo $data
echo "sampled num=" $num
echo "great than 80 num" $base80_counter
echo "great than 85 num" $base85_counter
consume_average=`cat $2|grep "consume"|awk -F '==' '{print $3}'|awk '{ sum += $1; } END { print sum/NR }'`
consume_top=`cat $2|grep "consume"|awk -F '==' '{print $3}'|awk -F '==' '{print $1}'|awk -F ' ' '{print $1}'|sort -n|tail -1`
consume_counter=`cat $2|grep "consume"|awk -F '==' '{print $3}'|awk -F '==' '{print $1}'|wc -l`
echo "consume_average=" $consume_average
echo "consume_top=" $consume_top
echo "consume_counter=" $consume_counter
-
运行结果如下:
运行结果解释,采样900条数据,cpu占用率大于80%有70条,cpu占用率大于85%的23条,并发总体平均消耗时间为14308ms,最大消耗时间为14803ms,总共并发27次。
来源:CSDN
作者:cft56200_ln
链接:https://blog.csdn.net/caofengtao1314/article/details/104674793