使用Jenkins和Jmeter搭建性能测试平台
参考文档:http://blog.csdn.net/liuchunming033/article/details/52186157
jenkins的性能测试结果展现插件:https://wiki.jenkins-ci.org/display/JENKINS/Performance+Plugin
maven执行使用的jmeter插件:https://github.com/jmeter-maven-plugin/jmeter-maven-plugin
Jmeter-maven-plugin高级配置之选择测试脚本
在pom.xml文件中可以指定运行哪些jmx脚本。
运行所有的测试脚本
Jmeter默认运行${project.base.directory}/src/test/jmeter文件夹中的所有脚本,下面是示例。
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
</project>
运行mvn verify
即可。
使用<testFilesIncluded>指定运行的脚本文件
我们可以通过<testFilesIncluded>这个标签来手动指定jmx文件。样例如下:
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<testFilesIncluded>
<jMeterTestFile>test1.jmx</jMeterTestFile>
<jMeterTestFile>test2.jmx</jMeterTestFile>
</testFilesIncluded>
</configuration>
</execution>
</executions>
</plugin>
当我们执行mvn verify
时,只有${project.base.directory}/src/test/jmeter文件夹中的test1.jmx、test2.jmx会执行。
在<testFilesIncluded>中使用正则表达式
<testFilesIncluded>标签支持正则表达式,下面的示例,指定以foo开头的所有jmx文件。
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<testFilesIncluded>
<jMeterTestFile>foo*.jmx</jMeterTestFile>
</testFilesIncluded>
</configuration>
</execution>
</executions>
</plugin>
使用<testFilesExcluded>标签反向指定jmx文件
我们还可以使用排除法,来指定不要运行${project.base.directory}/src/test/jmeter文件夹中的文件。样例:
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<testFilesExcluded>
<excludeJMeterTestFile>test3.jmx</excludeJMeterTestFile>
<excludeJMeterTestFile>test4.jmx</excludeJMeterTestFile>
</testFilesExcluded>
</configuration>
</execution>
</executions>
</plugin>
当我们运行mvn verify
时,${project.base.directory}/src/test/jmeter文件夹中除了test3.jmx和test4.jmx,其他的jmx文件都会执行。
<testFilesExcluded>标签使用正则表达式
反向指定jmx文件时,也可以使用正则表达式,样例:
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<testFilesExcluded>
<excludeJMeterTestFile>*bar.jmx</excludeJMeterTestFile>
</testFilesExcluded>
</configuration>
</execution>
</executions>
</plugin>
运行时,以bar结束的jmx文件都会排除在外。
<testFilesDirectory>标签指定jmx文件夹
我们还可以自定义jmx文件的位置(默认是${project.base.directory}/src/test/jmeter)。
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<testFilesDirectory>/scratch/testfiles/</testFilesDirectory>
</configuration>
</execution>
</executions>
</plugin>
各个配置含义及解读:https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Advanced-Configuration
使用Jenkins和Jmeter搭建性能测试平台的更多相关文章
- jenkins+ant+jmeter自动化性能测试平台
jenkins+ant+jmeter自动化性能测试平台 Jmeter是性能测试的工具,java编写.开源,小巧方便,可以图形界面运行也可以在命令行下运行.网上已经有人使用ant来运行,http://w ...
- 【转】Jenkins+Ant+Jmeter自动化性能测试平台
Jmeter是性能测试的工具,java编写.开源,小巧方便,可以图形界面运行也可以在命令行下运行.网上已经有人使用ant来运行,,既然可以使用ant运行,那和hudson.jenkins集成就很方便了 ...
- window平台基于influxdb + grafana + jmeter 搭建性能测试实时监控平台
一.influxdb 安装与配置 1.1 influxdb下载并安装 官网无需翻墙,但是下载跳出的界面需要翻墙,我这里提供下载链接:https://dl.influxdata.com/influxdb ...
- Jenkins+Ant+Jmeter搭建持续集成的接口测试平台(转)
一.什么是接口测试? 接口测试是测试系统组件间接口的一种测试.接口测试主要用于检测外部系统与系统之间以及内部各个子系统之间的交互点.测试的重点是要检查数据的交换,传递和控制管理过程,以及系统间的相互逻 ...
- 基于jmeter的性能测试平台(一)分布式jmeter搭建
(1)概述 一台windows虚拟机作为controller,3台Linux虚拟机作为agent. 第一步是在所有虚拟机上安装JDK,版本最好是一样的,然后就是下载安装jmeter,网上资料很多这里不 ...
- 【转】Jenkins+Ant+Jmeter搭建持续集成的接口测试平台
一.什么是接口测试? 接口测试是测试系统组件间接口的一种测试.接口测试主要用于检测外部系统与系统之间以及内部各个子系统之间的交互点.测试的重点是要检查数据的交换,传递和控制管理过程,以及系统间的相互逻 ...
- jenkins+ant+jmeter搭建持续集成的接口测试平台
一.jemter接口脚本的编写步骤如下: 1. 编写接口请求 通过录制或者查看接口文档,编写接口请求,进行调试,确保接口调试通过,对于http的请求来说,就是正确的填写域名,查询字符串,查询参数等信息 ...
- 【接口测试】Jenkins+Ant+Jmeter搭建持续集成的接口测试平台
参考文档: http://www.cnblogs.com/liuqi/p/5224579.html
- 基于jmeter的性能测试平台(二) 一个构想
之前基于jmeter搭好了分布式测试平台,但是感觉还是很粗糙,打算给它穿点衣服. 整个架构差不多就像下面这个图. (1)基于python django做一个web页面,友好地管理测试过程 (2)con ...
随机推荐
- spring调用方法(接口和多个实现类的情况)
以spring框架注入bean说明接口TestService 有2个实现类 TestServiceImp1 @Service("TestService1") ,TestServic ...
- CSUOJ 1901 赏赐 OR 灾难 单调栈
Description 大G南征北战终于打下了大片土地成立了G国,大G在开国大典上传召帮助自己南征北战的三大开国元勋小A,小B,小C进殿,并要赏赐三人大量宝物以显示天恩浩荡.大G在征服其他国家的时候抢 ...
- tomcat如何利用waf进行防护
近期某一实验室遇到一个问题:web环境是windows+tomcat+mysql,检测到cookie注入,此时又不想修改代码.此时两种方案进行解决: 1.利用安软(waf)类进行检测防御.这里国内主要 ...
- [leetcode sort]57. Insert Interval
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessa ...
- iOS WKWebview 网页开发适配指南
iOS WKWebview 网页开发适配指南 微信iOS客户端将于2017年3月1日前逐步升级为WKWebview内核,需要网页开发者提前做好网站的兼容检查和适配.如有问题,可参考文末联系方式,向我们 ...
- 使用gSOAP工具生成onvif框架代码
<工具产生背景> 由于SOAP是一种基于xml的文件,手动编写SOAP文件太机械耗时,在这种背景下产生了gSAOP 这个工具,用于生成各种类型的代码,目前支持C/C++, ...
- collection 和 collections
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha collection 是集合的意思. 集合 是 集合类的上级接口, 比如 set 和 l ...
- LOJ.114.K大异或和(线性基)
题目链接 如何求线性基中第K小的异或和?好像不太好做. 如果我们在线性基内部Xor一下,使得从高到低位枚举时,选base[i]一定比不选base[i]大(存在base[i]). 这可以重构一下线性基, ...
- 【拉格朗日插值法】【找规律】【高精度】Gym - 101156G - Non-Attacking Queens
题意:问你n*n的国际象棋棋盘上放3个互不攻击皇后的方案数. oeis……公式见代码内 //a(n) = 5a(n - 1) - 8a(n - 2) + 14a(n - 4) - 14a(n - 5) ...
- Codeforces Round #350 (Div. 2) A. Holidays 水题
A. Holidays 题目连接: http://www.codeforces.com/contest/670/problem/A Description On the planet Mars a y ...