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. 在调用相机后idleTimerDisabled失效的问题

    在调用相机后idleTimerDisabled失效的问题 相关资料: http://stackoverflow.com https://github.com/jamiemcd 问题 前几天有人在群里边 ...

  2. iOS开发之应用程序启动图片规格

    一个app在启动过程中会全屏显示叫做Default.png的图片 各种规格Default的使用场合: Default.png:非retina-iPhone屏幕,320x480 Default@2x.p ...

  3. (转)开源分布式搜索平台ELK(Elasticsearch+Logstash+Kibana)入门学习资源索引

    Github, Soundcloud, FogCreek, Stackoverflow, Foursquare,等公司通过elasticsearch提供搜索或大规模日志分析可视化等服务.博主近4个月搜 ...

  4. media query(媒体查询)和media type(媒体类型)

    media type(媒体类型)是css 2中的一个非常有用的属性,通过media type我们可以对不同的设备指定特定的样式,从而实现更丰富的界面.media query(媒体查询)是对media ...

  5. 解决codeblock不能运行的问题

    codeblock 编译失败 软件 IDE codeblock这软件的确不错,但是除此安装使用就会不小心入坑.你是不是满心欢喜的下载好codeblock,敲入代码,点击运行的时候却总是没反应呢? 如果 ...

  6. HTTP认证

    参考博文:HTTP协议详解 HTTP请求报头: Authorization HTTP响应报头: WWW-Authenticate HTTP认证是基于质询/回应(challenge/response)的 ...

  7. 【转】Eclipse 如何添加Android SDK

      问题描述: 如何为Eclipse编程软件添加Android SDK功能,使其能进行Android开发. 解决方法: 软件版本:Eclipse 3.7,installer_r18-windows.e ...

  8. 【转】Flash字体嵌入方法

    原文链接:http://www.cnblogs.com/ddw1997/archive/2011/11/13/2247546.html 一.如果使用flash cs5.5 1.先新建一个字体fla文件 ...

  9. State模式学习笔记

    选用了一个假设需要用户验证的例子进行State模式学习,这个例子并不恰当.无所谓了,只要能学习到其中的内容即可. 适用性: 1,一个对象的行为取决于他的状态,并且它必须在运行时刻依据状态改变他的行为. ...

  10. 封装Echarts

    项目中需要对数据进行图形展示,例如展示柱状图.饼状图等.这类的前端展示脚本很多,常见的是HighCharts和Echarts.HighCharts是基于svg技术的,而echarts基于Echarts ...