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
最新文章
- CA签发工具
- Windows Azure Virtual Machine (32) 如何在Windows操作系统配置SFTP
- UIScrollview自动布局,UIScrollviewAutolayoutDemo
- ural 1437. Gasoline Station
- 第五篇 SQL Server安全架构和安全
- Hanoi T note
- 解决在 使用 AjaxFileUploder 插件时,不能获取返回的 json 结果数据
- 源码分析:静态分析 C 程序函数调用关系图
- 单独调用Ueditor的图片上传功能
- phpcms 源码分析一: common.inc.php
- [JIT_APP]Android SQLite简介
- ThinkPHP URL伪静态、路由规则、重写、生成
- xml解析之使用dom4j的api对xml文件进行CRUD(二)
- Django+Vue打造购物网站(四)
- numpy 库简单使用
- 应用程序与驱动程序通信 DeviceIoControl
- 解决webgl使用canvas.toDataURL()没有内容的问题
- CImageList
- layui实现复选框全选,反选
- 基于python的scrapy框架爬取豆瓣电影及其可视化