tpcc-mysql的安装:http://www.cnblogs.com/lizhi221/p/6814003.html
tpcc-mysql的使用:http://www.cnblogs.com/lizhi221/p/6814014.html
 
前提,已经按照好gnuplot并支持jpeg【直接yum安装即可:yum install gnuplot】
 
1、使用tpcc-mysql压测数据库,得到压测结果文件
[root@localhost tpcc-mysql]# ./tpcc_start -h127.0.0.1 -P3306 -d sampson -u root -p mysql -w 1 -c 10 -r 60 -l 60 > tpcc-output/tpcc-output-1038.log
[root@localhost tpcc-mysql]# ./tpcc_start -h127.0.0.1 -P3306 -d sampson -u root -p mysql -w 2 -c 10 -r 60 -l 60 > tpcc-output/tpcc-output-1047.log
 
2、使用tpcc-output-analyze.sh脚本获取压测结果文件中的每次的事务数,并将结果写到制定的TXT文本中
[root@localhost tpcc-mysql]# ./tpcc-output-analyze.sh tpcc-output/tpcc-output-1038.log > tpcc-output/tpcc-1038-data.txt
[root@localhost tpcc-mysql] # cat tpcc-output/tpcc-1038-data.txt
10 599
20 643
30 746
40 730
50 688
60 770
 
[root@localhost tpcc-mysql]# ./tpcc-output-analyze.sh tpcc-output/tpcc-output-1047.log > tpcc-output/tpcc-1047-data.txt
[root@localhost tpcc-mysql] # cat tpcc-output/tpcc-1047-data.txt
10 153
20 159
30 168
40 175
50 145
60  93
 
3、将两个文本合并
[root@localhost tpcc-mysql]# paste tpcc-output/tpcc-1038-data.txt tpcc-output/tpcc-1047-data.txt > tpcc-output/tpcc-graph-data-0504.txt
[root@localhost tpcc-mysql] # cat tpcc-output/tpcc-graph-data-0504.txt
10 599    10 153
20 643    20 159
30 746    30 168
40 730    40 175
50 688    50 145
60 770    60  93
 
4、使用tpcc-graph-build.sh脚本生成图表
[root@localhost tpcc-mysql]#./tpcc-graph-build.sh tpcc-output/tpcc-graph-data-0504.txt tpcc-output/tpcc-graph-0504.jpg
 
注:

plot datafile using 1:2 title "MySQL 5.7.17, w=1 c=10" with lines,\
datafile using 3:4 title "MySQL 5.7.17, w=2 c=10" with lines axes x1y1
【这里的using对应tpcc-graph-data-0504.txt的列,using 1:2即使用1、2列 】
 
图表显示:

[root@localhost tpcc-mysql] # cat tpcc-output-analyze.sh
#!/bin/sh
TIMESLOT=1
if [ -n "$2" ]
then
TIMESLOT=$2
fi
cat $1 | grep -v HY000 | grep -v payment | grep -v neword | awk -v timeslot=$TIMESLOT 'BEGIN { FS="[,():]"; s=0; cntr=0; aggr=0 } /MEASURING START/ { s=1} /STOPPING THREADS/ {s=0} /0/ { if (s==1) { cntr++; aggr+=$2; } if ( cntr==timeslot ) { printf ("%d %3d\n",$1,(aggr/timeslot)) ; cntr=0; aggr=0 } }'
 
[root@localhost tpcc-mysql] # cat tpcc-graph-build.sh
#!/bin/bash
 
### goto user homedir and remove previous file
rm -f '$2'
 
gnuplot << EOP
 
### set data source file
datafile = '$1'
 
### set graph type and size
set terminal jpeg size 640,480
 
### set titles
set grid x y
set xlabel "Time (sec)"
set ylabel "Transactions"
 
### set output filename
set output '$2'
 
### build graph
# plot datafile with lines
plot datafile using 1:2 title "MySQL 5.7.17, w=1 c=10" with lines,\
datafile using 3:4 title "MySQL 5.7.17, w=2 c=10" with lines axes x1y1
 
EOP
 

使用gnuplot对tpcc-mysql压测结果生成图表的更多相关文章

  1. 03:TPCC 基准压测my.cnf

    line: V1.3 mail: gczheng@139.com date: 2017-11-09 一.TPCC测试前准备 1.压测环境 配置 信息 主机 Dell PowerEdge R730xd ...

  2. 【JMeter】(3)---MySQL压测

    JMeter---MySQL压测 一.添加MySQL驱动jar包 在测试计划(Test Plan)页面添加jar包 二.添加MySQL连接配置 添加线程组右击-->添加(add)-->配置 ...

  3. MySQL 压测

    https://mp.weixin.qq.com/s/vKJZp5cGUetHokGh2EZUXg mysqlslap --iterations=100 --create-schema='test' ...

  4. JMeter使用教程2——MySQL压测

    之前写过一篇JMeter使用教程,只是介绍了http请求的压力测试,想到MySQL的测试也挺必要的,于是写下这篇记录一下.如果不知道怎么下载和安装,可以看一下上一篇关于JMeter的文章,地址是:ht ...

  5. jmeter进行MySQL压测

    jmeter怎么对数据库进行压测 目录 jmeter怎么对数据库进行压测 点击测试计划,再点击"浏览",把JDBC驱动添加进来: 然后添加配置元件 再添加一个采样器:JDBC re ...

  6. Mysql压测工具mysqlslap 讲解

    在mysql5.1以后的版本:客户端带了个工具mysqlslap可以对mysql进行压力测试: 可以使用mysqlslap --help来显示使用方法: Default options are rea ...

  7. MySQL压测中遇到的一些问题

    批量insert http://blog.csdn.net/xiaoxian8023/article/details/20155429 Mysql jdbc 批处理数据,需要给jdbc连接加上rewr ...

  8. sysbench 1.0.9 mysql 压测工具安装使用

    备注:    安装比较简单,可以使用源码或者使用yum 进行安装,本次测试使用yum    注意1.0 之后版本与老版本改动比较大,好多地方都有修改,本次测试使用    的mysql 使用docker ...

  9. jmeter非GUI模式如何压测并生成测试报告

    在启动Jmeter时,我们会看到这样一句提示: 不要使用GUI模式(界面模式)进行负载测试,GUI模式只能用于创建测试和调试.进行负载测试时,需要时用非GUI模式. 那么为什么进行负载测试时一定要用非 ...

随机推荐

  1. 如何在RecyclerView上面实现"拖放"和"滑动删除"-2

    拖动手柄 在设计一个支持"拖放"的列表时, 通常提供一个在触摸时初始化拖拽的"拖动手柄". 因其可发现性和可用性而被Material Guidelines所推荐 ...

  2. Redis(2015.08.03笔记一)

    一.redis简介 Redis是一种面向"键/值"对数据类型的内存数据库,可以满足我们对海量数据的读写需求. redis的键只能是字符串 redis的值支持多种数据类型: 1:字符 ...

  3. Docker(开课吧笔记)

    1.Docker基本概念 Docker运行在Linux,需要git技能 docker官网解析   来源于容器又不仅仅是容器,第一个版本基于LXC,远远超过容器概念   交付时拿到的是镜像,直接run运 ...

  4. 【iOS】7.4 定位服务->2.1.4 定位 - 官方框架CoreLocation 案例:指南针效果

    本文并非最终版本,如果想要关注更新或更正的内容请关注文集,联系方式详见文末,如有疏忽和遗漏,欢迎指正. 本文相关目录: ================== 所属文集:[iOS]07 设备工具 === ...

  5. SSH里面使用jQuery的ajax

    今天我真的很兴奋!在我的SSH项目中用jQuery的异步传输成功了,经过一天多的奋战,大工告成! 我的项目需求是在javascript中向我的controller(即:action)中传输form表单 ...

  6. Dive in python Chapter3 实例

    def buildConnectionString(params): """Build a connection string from a dictionary Ret ...

  7. Frame框架

    框架 frameset    框架集    如果使用框架集,当前页面不能有body    cols="300,*" :左右拆分,左边宽300,右边宽剩余    rows=" ...

  8. iOS打包后收不到推送信息

    今天遇到的一个特别神奇的问题: 应用在测试环境下打的包收不到推送了,打包之后都没有推送,但是我真机测试又是可以收到推送消息的.经过好久才找到原因,感觉很坑.这里记录一下问题: 1.由于我的推送第三方使 ...

  9. PRINCE2 有级别吗?

    PRINCE2是分级别的,有基础级和专业级两个级别 Foundation基础级考试没有报考条件限制, 完全根据学员掌握知识的能力和实际工作经验 Practitioner 专业级考试不可越级 1.持有P ...

  10. java随机数生成的原理

    一.在j2se里我们可以使用Math.random()方法来产生一个随机数,这个产生的随机数是0-1之间的一个double,我们可以把他乘以一定的数,比如说乘以100,他就是个100以内的随机,这个在 ...