首页 > 其他分享 >【jmeter】执行jmeter的脚本的常用命令行

【jmeter】执行jmeter的脚本的常用命令行

时间:2023-05-15 16:22:24浏览次数:50  
标签:脚本 jmeter ____ SLF4J 测试 常用命令 ___ 执行

一、jmeter命令帮助

 jmeter --help
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/apache-jmeter-5.4/lib/log4j-slf4j-impl-2.13.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/apache-jmeter-5.4/lib/ext/jmeter-grpc-request.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
    _    ____   _    ____ _   _ _____       _ __  __ _____ _____ _____ ____
   / \  |  _ \ / \  / ___| | | | ____|     | |  \/  | ____|_   _| ____|  _ \
  / _ \ | |_) / _ \| |   | |_| |  _|    _  | | |\/| |  _|   | | |  _| | |_) |
 / ___ \|  __/ ___ \ |___|  _  | |___  | |_| | |  | | |___  | | | |___|  _ <
/_/   \_\_| /_/   \_\____|_| |_|_____|  \___/|_|  |_|_____| |_| |_____|_| \_\ 5.4

Copyright (c) 1999-2020 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]

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

To run Apache JMeter in server mode:
Open a command prompt and type:

jmeter-server.bat(Windows)/jmeter-server(Linux)

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

二、常用命令参数

如上所示,相关参数描述如下:
-n 非GUI模式,命令行模式(表示在非GUI模式下运行)
-t 测试文件, 要运行的jmeter测试脚本文件(一般使用绝对路径)
-l 结果文件,记录结果的文件
-h 获取jmeter帮助信息
-r 远程执行,启动远程服务器(non-gui模式下启动remote-hosts配置的所有远程代理机)
-R 远程执行,(non-gui模式下启动指定的机器(IP:PORT)作为代理机)
-e 设置测试完成后生成测试报表
-o 指定测试报表生成的文件夹,文件夹必须为空/不存在
-H 代理主机(设置jmeter使用的代理主机)
-P 代理端口(设置jmeter使用的代理端口)
-X 退出(non-gui模式下测试结束时退出)

 

三、执行脚本

1)单机执行

jmeter -n -t .\测试-load.jmx  -l .\report.jtl

2)远程执行-所有执行机执行

jmeter -n -t .\测试-all.jmx  -r -l .\report.jtl

3)远程执行-指定执行机执行

jmeter -n -t .\测试-load.jmx  -R 192.168.xx.xxx  -l .\report.jtl

多个ip可以使用英文逗号分开

 

四、生成报告

jmeter -g .\report.jtl -o .\report

 

 

参考链接

(78条消息) 命令行运行JMeter详解_jmeter命令行执行脚本_一只爱吃橙子的小蜗牛的博客-CSDN博客

(78条消息) jmeter命令行的方式执行jmeter脚本_jmeter命令行执行脚本_ldt117354的博客-CSDN博客

 

标签:脚本,jmeter,____,SLF4J,测试,常用命令,___,执行
From: https://www.cnblogs.com/fireblackman/p/17402244.html

相关文章

  • 【jmeter】分布式如何设置唯一变量值(二)
    如果您在JMeter分布式测试中需要产生唯一值,可以使用以下两种方法:1、Redis数据存储器:Redis是一个开源、基于内存的、支持多种数据结构的NoSQL数据库。可通过使用Redis数据存储器来生成唯一值。详情请参见Redis数据存储器配置示例。 2、-Counter功能:可以使用-JMeter的计数器功......
  • 【jmeter】分布式如何设置唯一变量值(一)
    在JMeter分布式测试中,每个被测试的目标机器都会启动一个JMeter客户端进行测试。这会导致变量可能不唯一的问题。为了确保变量的唯一性,在执行分布式测试时可以使用以下方法:1、使用__UUID函数在测试计划中使用__UUID函数可以生成唯一的值。例如,在需要使用时间戳作为变量的值时,......
  • linux常用命令
    crul"访问地址"模拟访问地址ps-ef|grepelastices的运行状态./elasticsearch-des启动命令exit退出当前用户chown-Relastic:elastic*增加目录权限和冒号后面迭代所有的目录rm-rf文件删除文件cp拷贝的文件拷贝文件的目录和文件名./shutdown.sh关闭tomcat./......
  • centos初始化脚本
    #!/bin/bash#vim/etc/resolv.conf#nameserver8.8.8.8#google域名服务器#nameserver8.8.4.4#google域名服务器#修改源cd/etc/yum.repos.d/mvCentOS-Base.repoCentOS-Base.repo.backupwget-O/etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/re......
  • Gnome设置工作区系列按键跟i3一样脚本
    zsh执行gsettingssetorg.gnome.shell.extensions.dash-to-dockhot-keysfalsedconfwrite/org/gnome/shell/extensions/dash-to-panel/hot-keysfalsedconfwrite/org/gnome/shell/extensions/dash-to-panel/hotkey-prefix-text"''"foriin$(se......
  • (一)shell 脚本基础
    观看视频:https://www.bilibili.com/video/BV14L4y157Bv/?spm_id_from=333.999.0.0介绍shell是一个命令行解释器,它接收应用程序/用户命令,然后调用操作系统内核。shell还是一个功能强大的编程语言,易编写、易调试、灵活性强。第一行的作用#!/bin/bashShebang在计算机程序中,s......
  • elasticsearch脚本查询
    脚本查询概念Scripting是Elasticsearch支持的一种专门用于复杂场景下支持自定义编程的强大的脚本功能,ES支持多种脚本语言,如painless,其语法类似于Java,也有注释、关键字、类型、变量、函数等,其就要相对于其他脚本高出几倍的性能,并且安全可靠,可以用于内联和存储脚本。支持的......
  • crontab设置定时任务脚本文件每秒运行一次,每个月最后一天的21点到22点 每20分钟(1200秒
    每秒运行一次#!/bin/bashstep=2for((i=0;i<60;i=(i+step)));dophp/home/www/tp6/thinkzhangsleep$stepdoneexit0每个月最后一天的21点到22点20分钟(1200)执行一次#!/bin/bashtoday=`date+%d`hour=`date+%H`last_day=`cal|xargs|awk'{print$NF}'`if["$to......
  • 实用的网络流量监控脚本
     #!/bin/bashif[-n"$1"];theneth_name=$1elseeth_name="eth0"fii=0send_o=`/sbin/ifconfig$eth_name|grepbytes|awk'{print$6}'|awk-F:'{print$2}'`recv_o=`/sbin/ifconfig$eth......
  • Linux常用命令-ftp
    ftp-Internetfiletransferprogram常用命令命令用法描述[email protected]连接到FTP服务器lsls[remote-directory]列出远程目录的内容cdcd[remote-directory]更改远程目录lcdlcd[local-directory]更改本地目录mkdirmkdir[direc......