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. vue学习笔记 实例(二)

    var data = {a: 1} var vm = new Vue({ el: '#example', data: data, created: function () { // `this` 指向 ...

  2. JavaScript高级程序设计---学习笔记(一)

    今天,2017.3.17开始利用课余时间仔细学习<JavaScript高级程序设计>,将需要掌握的知识点记录下来,争取把书里的所有代码敲一遍并掌握. 1.标识符命名最好是第一个字母小写,剩 ...

  3. Sublime Text 3下载-汉化-插件配置

    Sublime Text 3下载 不用说是上官方下载地址:http://www.sublimetext.com/3 Sublime Text 3 免费使用方法 Sublime Text 2的时候还有一 ...

  4. CI框架剖析一

            CodeIgniter 是一个小巧但功能强大的 PHP 框架,作为一个简单而"优雅"的工具包,它可以为开发者们建立功能完善的 Web 应用程序.本人使用CI框架有一 ...

  5. Html5-测试Canvas

      // 浏览器不支持Html5 Canvas"; var theCanvas=document.getElementById("canvas_one"); if(!th ...

  6. 老李推荐:第14章9节《MonkeyRunner源码剖析》 HierarchyViewer实现原理-遍历控件树查找控件

    老李推荐:第14章9节<MonkeyRunner源码剖析> HierarchyViewer实现原理-遍历控件树查找控件   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员 ...

  7. Java类修饰符

  8. git初学笔记1

    之前对于软件的版本管理全靠粘贴辅助,觉得很low,而且也不是很方便.听前辈说git很好用,然后就学了一下. 今天主要学了些基本的操作命令,总结如下: 1. git最基本的操作  2. commit提交 ...

  9. poj 3070 Fibonacci (矩阵快速幂乘/模板)

    题意:给你一个n,输出Fibonacci (n)%10000的结果 思路:裸矩阵快速幂乘,直接套模板 代码: #include <cstdio> #include <cstring& ...

  10. js根据条件json生成随机json:randomjson

    前端开发中,在做前后端分离的时候,经常需要手写json数据,有3个问题特别揪心: 1,数据是写死的,不能按一定的条件随机生成长度不一,内容不一的数据 2,写数组的时候,如果有很多条,需要一条一条地写, ...