Locust性能测试6-命令行参数详解
前言
当我们在linux上使用locust工具压测的时候,会使用no-web模式,然后需要收集运行的日志,方便查找问题。
命令行参数
输入locust --help 查看所有的命令行参数
> locust --help
Usage: locust [options] [LocustClass [LocustClass2 ... ]]
Options:
-h, --help show this help message and exit
-H HOST, --host=HOST Host to load test in the following format:
http://10.21.32.33
--web-host=WEB_HOST Host to bind the web interface to. Defaults to '' (all
interfaces)
-P PORT, --port=PORT, --web-port=PORT
Port on which to run web host
-f LOCUSTFILE, --locustfile=LOCUSTFILE
Python module file to import, e.g. '../other.py'.
Default: locustfile
--csv=CSVFILEBASE, --csv-base-name=CSVFILEBASE
Store current request stats to files in CSV format.
--master Set locust to run in distributed mode with this
process as master
--slave Set locust to run in distributed mode with this
process as slave
--master-host=MASTER_HOST
Host or IP address of locust master for distributed
load testing. Only used when running with --slave.
Defaults to 127.0.0.1.
--master-port=MASTER_PORT
The port to connect to that is used by the locust
master for distributed load testing. Only used when
running with --slave. Defaults to 5557. Note that
slaves will also connect to the master node on this
port + 1.
--master-bind-host=MASTER_BIND_HOST
Interfaces (hostname, ip) that locust master should
bind to. Only used when running with --master.
Defaults to * (all available interfaces).
--master-bind-port=MASTER_BIND_PORT
Port that locust master should bind to. Only used when
running with --master. Defaults to 5557. Note that
Locust will also use this port + 1, so by default the
master node will bind to 5557 and 5558.
--heartbeat-liveness=HEARTBEAT_LIVENESS
set number of seconds before failed heartbeat from
slave
--heartbeat-interval=HEARTBEAT_INTERVAL
set number of seconds delay between slave heartbeats
to master
--expect-slaves=EXPECT_SLAVES
How many slaves master should expect to connect before
starting the test (only when --no-web used).
--no-web Disable the web interface, and instead start running
the test immediately. Requires -c and -r to be
specified.
-c NUM_CLIENTS, --clients=NUM_CLIENTS
Number of concurrent Locust users. Only used together
with --no-web
-r HATCH_RATE, --hatch-rate=HATCH_RATE
The rate per second in which clients are spawned. Only
used together with --no-web
-t RUN_TIME, --run-time=RUN_TIME
Stop after the specified amount of time, e.g. (300s,
20m, 3h, 1h30m, etc.). Only used together with --no-
web
-L LOGLEVEL, --loglevel=LOGLEVEL
Choose between DEBUG/INFO/WARNING/ERROR/CRITICAL.
Default is INFO.
--logfile=LOGFILE Path to log file. If not set, log will go to
stdout/stderr
--print-stats Print stats in the console
--only-summary Only print the summary stats
--no-reset-stats [DEPRECATED] Do not reset statistics once hatching has
been completed. This is now the default behavior. See
--reset-stats to disable
--reset-stats Reset statistics once hatching has been completed.
Should be set on both master and slaves when running
in distributed mode
-l, --list Show list of possible locust classes and exit
--show-task-ratio print table of the locust classes' task execution
ratio
--show-task-ratio-json
print json data of the locust classes' task execution
ratio
-V, --version show program's version number and exit
参数说明
| 参数名称 | 参数值 | 参数说明 |
|---|---|---|
| -h, --help | 不带参数 | 查看帮助信息 |
| -H HOST, –host=HOST | HOST | 指定被测试的主机,采用以格式:http://10.21.32.33 |
| –web-host=WEB_HOST | WEB_HOST | 指定运行 Locust Web 页面的主机,默认为空 “。 |
| -P PORT, –port=PORT, –web-port=PORT | PORT | 指定 –web-host 的端口,默认是8089 |
| -f LOCUSTFILE, –locustfile=LOCUSTFILE | LOCUSTFILE | 指定运行 Locust 性能测试文件,默认为: locustfile.py |
| –csv=CSVFILEBASE, –csv-base-name=CSVFILEBASE | CSVFILEBASE | 以CSV格式存储当前请求测试数据。 |
| –master | 不带参数 | Locust 分布式模式使用,当前节点为 master 节点。 |
| –slave | 不带参数 | Locust 分布式模式使用,当前节点为 slave 节点。 |
| –master-host=MASTER_HOST | MASTER_HOST | 分布式模式运行,设置 master 节点的主机或 IP 地址,只在与 –slave 节点一起运行时使用,默认为:127.0.0.1. |
| –master-port=MASTER_PORT | MASTER_PORT | 分布式模式运行, 设置 master 节点的端口号,只在与 –slave 节点一起运行时使用,默认为:5557。注意,slave 节点也将连接到这个端口+1 上的 master 节点。 |
| –master-bind-host=MASTER_BIND_HOST | MASTER_BIND_HOST | 做分布式压测时,指定分机IP。只用于master。如果没有指定,默认是所有可用的IP(即所有标记主机IP的slave) |
| –master-bind-port=MASTER_BIND_PORT | MASTER_BIND_PORT | 做分布式压测时,指定分机port。默认是5557与5558。 |
| –no-web no-web | -c 和 -r 配合 | 模式运行测试,需要 -c 和 -r 配合使用. |
| -c NUM_CLIENTS, –clients=NUM_CLIENTS | NUM_CLIENTS | 指定并发用户数,作用于 –no-web 模式。 |
| -r HATCH_RATE, –hatch-rate=HATCH_RATE | HATCH_RATE | 指定每秒启动的用户数,作用于 –no-web 模式。 |
| -t RUN_TIME, –run-time=RUN_TIME | RUN_TIME | 设置运行时间, 例如: (300s, 20m, 3h, 1h30m). 作用于 –no-web 模式。 |
| -L LOGLEVEL, –loglevel=LOGLEVEL | LOGLEVEL | 选择 log 级别(DEBUG/INFO/WARNING/ERROR/CRITICAL). 默认是 INFO. |
| –logfile=LOGFILE | LOGFILE | 日志文件路径。如果没有设置,日志将去 stdout/stderr |
| –print-stats | 不带参数 | 在控制台中打印数据 |
| –only-summary | 不带参数 | 只打印摘要统计 |
| –no-reset-stats | 不带参数 | Do not reset statistics once hatching has been completed。 |
| -l, –list | 不带参数 | 显示测试类, 配置 -f 参数使用 |
| –show-task-ratio | 不带参数 | 打印 locust 测试类的任务执行比例,配合 -f 参数使用. |
| –show-task-ratio-json | 不带参数 | 以 json 格式打印 locust 测试类的任务执行比例,配合 -f 参数使用. |
| -V, –version | 不带参数 | 查看当前 Locust 工具的版本. |
Locust性能测试6-命令行参数详解的更多相关文章
- VLC命令行参数详解
VLC命令行参数详解 2012-11-29 14:00 6859人阅读 评论(0) 收藏 举报 Usage: vlc [options] [stream] ...You can specify mul ...
- httprunner学习15-运行用例命令行参数详解
前言 HttpRunner 在命令行中启动测试时,通过指定参数,可实现丰富的测试特性控制. 命令行参数CLI 使用 -h 查看相关命令行参数 hrun -h 参数名称 参数值 参数说明 -h, --h ...
- 以太坊客户端Geth命令用法-参数详解
Geth在以太坊智能合约开发中最常用的工具(必备开发工具),一个多用途的命令行工具. 熟悉Geth可以让我们有更好的效率,大家可收藏起来作为Geth命令用法手册. 本文主要是对geth help的翻译 ...
- free命令常用参数详解
free命令常用参数详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 在运维期间我们会经常去查看服务器硬件信息,比如说内存,大家可能知道看内存用“[root@yinzhengji ...
- 【转载】Linux字符集和系统语言设置-LANG,locale,LC_ALL,POSIX等命令及参数详解
Linux字符集和系统语言设置-LANG,locale,LC_ALL,POSIX等命令及参数详解 1清风揽月10人评论5006人阅读2017-06-21 15:48:43 博文说明[前言]: 本文 ...
- [转帖]XCopy复制文件夹命令及参数详解以及xcopy拷贝目录并排除特定文件
XCopy复制文件夹命令及参数详解以及xcopy拷贝目录并排除特定文件 https://www.cnblogs.com/smartsmile/p/7665979.html xcopy dirA dir ...
- linux-linux top 命令各参数详解
简介 top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器. top显示系统当前的进程和其他状况,是一个动态显示过程,即可以通过用户按 ...
- linux top 命令各参数详解
简介 top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器. top显示系统当前的进程和其他状况,是一个动态显示过程,即可以通过用户按 ...
- Java之jdk命令行工具详解
JPS---虚拟机进程状况工具 常用的参数: -l 输出Java应用程序的main class的完整包 -q 仅显示pid,不显示其它任何相关信息 -m 输出传递给main方法的参数 -v 输出传递给 ...
随机推荐
- Gamma展示
团队成员简介 团队成员 角色 个人博客地址 刘峻辰 后端开发 刘峻辰 焦云鹏 后端开发 焦云鹏 赵智源 测试&服务器部署 赵智源 肖萌威 前端开发 肖萌威 杨亦鑫 前端开发 杨亦鑫 戴荣 UI ...
- Windows彻底卸载VMWare虚拟机详细步骤
不能卸载vmware ,原因是VMware的服务在运行中,停止服务就可以卸载了. 点击开始输入[services.msc],然后点击搜索到服务. 找到这个软件的图一的所有项,然后右键它属性. 全部设置 ...
- 【IntelliJ IDEA学习之三】IntelliJ IDEA常用快捷键
版本:IntelliJIDEA2018.1.4 按场景列举一.打开设置CTRL + ALT + S:打开设置(File-->Settings...)Ctrl + Shift + Alt + S: ...
- GameZ游戏排名系统
GameZ游戏排名系统 GameZ为他们最新推出的游戏开通了一个网站.世界各地的玩家都可以将自己的游戏得分上传到网站上.这样就可以看到自己在世界上的排名.得分越高,排名就越靠前.当两个玩家的名次相同时 ...
- python入门之数据类型及内置方法
目录 一.题记 二.整形int 2.1 用途 2.2 定义方式 2.3 常用方法 2.3.1 进制之间的转换 2.3.2 数据类型转换 3 类型总结 三.浮点型float 3.1 用途 3.2 定义方 ...
- 使用Prometheus监控snmp
获取snmp信息 首先获取需要监控的snmp的基本信息,假设基本信息如下: snmp服务IP: 1.1.1.1 snmp community: public snmp exportor部署地址: 2. ...
- thinkphp伪静态怎么实现
thinkphp如何实现伪静态? 去掉 URL 中的 index.php ThinkPHP 作为 PHP 框架,是单一入口的,那么其原始的 URL 便不是那么友好.但 ThinkPHP 提供了各种机制 ...
- Effective.Java第23-33条(泛型相关)
23. 类结构层次优于标签类 有时你会碰到一个类,它的实例有一个或多个风格,并且包含一个tag属性表示实例的风格.例如,如下面的类表示一个圆或者矩形: public class Figure { / ...
- 使用springboot mybatis 查询时实体类中的驼峰字段值为null
看到返回结果以后主要分析了一下情况: 实体类的get.set方法确实 mapper.xml文件中的resultMap.resultType等原因导致 数据库中数据存在问题 经过检查与验证发现以上都不存 ...
- 【转载】linux 压缩和解压缩命令gz、tar、zip、bz2
linux系统下压缩解压缩很让人头大,每次都要查命令.转载下方便以后查阅.原文信息如下: 作者:capecape 来源:CSDN 原文:https://blog.csdn.net/capecape/a ...