mysql tps 测试_sysbench测试MySQL筛选tps

log=$1

tps_array=`awk -F '[,:]' '{print $4}' ${log}`

zero=0

for tps in ${tps_array}

do

tps=`echo ${tps} |tr -d "."`

if [ ${tps} -eq 0 ]

then

zero=`expr ${zero} + 1`

fi

done

echo "tps 0 num: ${zero}"

文件内容:

[99080s] threads: 128, tps: 7565.93, reads: 105918.67, writes: 30243.15, response time: 41.23ms (95%), errors: 0.40, reconnects: 0.00

[99085s] threads: 128, tps: 7376.95, reads: 103291.67, writes: 29528.20, response time: 42.85ms (95%), errors: 0.40, reconnects: 0.00

[99090s] threads: 128, tps: 7816.97, reads: 109409.52, writes: 31259.06, response time: 41.00ms (95%), errors: 0.20, reconnects: 0.00

[99095s] threads: 128, tps: 6850.42, reads: 95919.01, writes: 27381.86, response time: 45.20ms (95%), errors: 0.80, reconnects: 0.00

[99100s] threads: 128, tps: 7360.14, reads: 103057.95, writes: 29448.55, response time: 43.25ms (95%), errors: 0.20, reconnects: 0.00

[99105s] threads: 128, tps: 7158.81, reads: 100239.21, writes: 28658.47, response time: 44.37ms (95%), errors: 0.20, reconnects: 0.00

[99110s] threads: 128, tps: 7284.31, reads: 101984.49, writes: 29135.42, response time: 43.92ms (95%), errors: 0.20, reconnects: 0.00

[99115s] threads: 128, tps: 7268.57, reads: 101723.54, writes: 29040.05, response time: 43.01ms (95%), errors: 0.80, reconnects: 0.00

[99120s] threads: 128, tps: 7079.80, reads: 99116.06, writes: 28319.02, response time: 44.86ms (95%), errors: 0.20, reconnects: 0.00

[99125s] threads: 128, tps: 7551.02, reads: 105736.69, writes: 30216.08, response time: 41.34ms (95%), errors: 0.60, reconnects: 0.00

执行结果:

shell.sh  file

tps 0 num: 4

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值