jmeter非GUI模式_CLI模式_单点运行

由于 jmeter运行依赖java环境,所以首先要准备工作:

1、在linux机器上,安装 java 、jmeter,将对应的安装包放到相应的目录,然后进行解压即可

[mispauto@vm0080 opt]$ ls -rlt
total 520284
-rw-rw-r-- 1 mispauto mispauto 185516505 Jul 13 2017 jdk-8u141-linux-x64.tar.gz
-rw-rw-r-- 1 mispauto mispauto 62146506 Apr 25 21:18 apache-jmeter-5.2.1.tgz

 

2、运行非gui模式下运行命令就行了

/home/mispauto/usr/apache-jmeter-5.2.1/bin/jmeter -n -t /ulic/mysql_project/emisp.jmx -J thread=10 -J loopcount=-1 -J duration=300 -l /ulic/mysql_project/result/result10.jtl

 

 

 

其中:/home/mispauto/usr/apache-jmeter-5.2.1/bin/jmeter ----为jmeter部署所在路径

         -n     表示 非gui模式运行

          -t    后面表示,执行的 jmx脚本

         -l    报告输出路径

          -J  参数设置 (J是大写) 

 

 

查看 jmeter帮助

[preprd@vm0158 bin]$ sh jmeter --help
_ ____ _ ____ _ _ _____ _ __ __ _____ _____ _____ ____
/ \ | _ \ / \ / ___| | | | ____| | | \/ | ____|_ _| ____| _ \
/ _ \ | |_) / _ \| | | |_| | _| _ | | |\/| | _| | | | _| | |_) |
/ ___ \| __/ ___ \ |___| _ | |___ | |_| | | | | |___ | | | |___| _ <
/_/ \_\_| /_/ \_\____|_| |_|_____| \___/|_| |_|_____| |_| |_____|_| \_\ 5.2.1

Copyright (c) 1999-2019 The Apache Software Foundation


To list all command line options, open a command prompt and type:

jmeter.bat(Windows)/jmeter.sh(Linux) -?

--------------------------------------------------

To run Apache JMeter in GUI mode, open a command prompt and type:

jmeter.bat(Windows)/jmeter.sh(Linux) [-p property-file]

--------------------------------------------------

To run Apache JMeter in NON_GUI mode:
Open a command prompt (or Unix shell) and type:

jmeter.bat(Windows)/jmeter.sh(Linux) -n -t test-file [-p property-file] [-l results-file] [-j log-file]

--------------------------------------------------

To run Apache JMeter in NON_GUI mode and generate a report at end :
Open a command prompt (or Unix shell) and type:

jmeter.bat(Windows)/jmeter.sh(Linux) -n -t test-file [-p property-file] [-l results-file] [-j log-file] -e -o [Path to output folder]

--------------------------------------------------
To generate a Report from existing CSV file:
Open a command prompt (or Unix shell) and type:

jmeter.bat(Windows)/jmeter.sh(Linux) -g [csv results file] -o [path to output folder (empty or not existing)]

--------------------------------------------------

To tell Apache JMeter to use a proxy server:
Open a command prompt and type:

jmeter.bat(Windows)/jmeter.sh(Linux) -H [your.proxy.server] -P [your proxy server port]

 

PS:建议启动脚本中,所有文件,都带绝对路径

          

 

posted @ 2020-06-28 16:01  小晓风  阅读(195)  评论(0编辑  收藏  举报