1.1 增加Pom.xml依赖
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>logkit</groupId>
<artifactId>logkit</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>maven-jmeter-plugin</artifactId>
<version>1.0</version>
</dependency>
1.2 Maven mvn.bat调整
Maven工程bin/Mvn.bat运行参数增加CLASSPATH指示器。
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %CLASSWORLDS_JAR%;"C:Documents and Settingsjianzhao.liangjz.m2 epositorycommons-loggingcommons-logging1.0.4commons-logging-1.0.4.jar";"C:Documents and Settingsjianzhao.liangjz.m2 epositorylogkitlogkit1.0.1logkit-1.0.1.jar" "-Dclassworlds.conf=%M2_HOME%inm2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%
1.3 拷贝upgrade.properties到工程bin/目录下
拷贝jmeter/bin下文件upgrade.properties到如D:src
etty_websocketin目录下
1.4 创建一个jmx文件
用badboy录制google搜索过程,另存jmeter文件为google_search.jmx。
放到D:src
etty_websocketsrc estjmeter目录下
1.5 执行命令生成XML报告
可以mvn jmeter:jmeter,也可mvn verify。