Locust-命令行参数详解
前言
当我们在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 工具的版本. |
MyBatis -- 一步步教你使用MyBatis
简洁常用权限系统的设计与实现(一):构造权限菜单树的N(N>=4)种方法
2014年工作中遇到的20个问题:181-200
2014年工作中遇到的20个问题:181-200
老雷:思儿壮志小诗一首(老爸写得都比我好,让我这个文艺青年情何以堪)(家人对幸福美好生活的追求,就是我的奋斗目标)
老雷:思儿壮志小诗一首(老爸写得都比我好,让我这个文艺青年情何以堪)(家人对幸福美好生活的追求,就是我的奋斗目标)
雷观(十三):功能优先,开发与重构并举,性能殿后
雷观(十三):功能优先,开发与重构并举,性能殿后
URL传递中文参数,大坑一枚,Windows与Linux效果竟然不一致(两种解决方法)
- 最新文章
-
云计算设计模式(二十)——调度程序代理管理者模式
校园暑期的操场
[Xcode 实际操作]九、实用进阶-(17)使用CGBlendMode改变UIImage颜色,实现对图片进行混合着色
[Xcode 实际操作]九、实用进阶-(16)给图片添加水印效果
[Xcode 实际操作]九、实用进阶-(15)屏幕截屏:截取当前屏幕上的显示内容
[Xcode 实际操作]九、实用进阶-(14)使用富文本CoreText框架创建丰富多彩的文本
[Xcode 实际操作]九、实用进阶-(13)调用相机并获取拍摄后的图片
[Xcode 实际操作]九、实用进阶-(12)从系统相册中读取图片
[Xcode 实际操作]九、实用进阶-(11)系统本地通知的创建和使用
[Xcode 实际操作]九、实用进阶-(10)定位设备的使用
- 热门文章
-
[Xcode 实际操作]九、实用进阶-(9)陀螺仪设备的使用
[Xcode 实际操作]九、实用进阶-(8)实现App的Setting设置:添加和读取程序的配置信息
Android获取系统外置存储卡路径的方法
css position: relative,absolute具体解释
Alex 的 Hadoop 菜鸟教程: 第2课 hadoop 安装教程 (CentOS6 CDH分支 yum方式)
Android异步载入全解析之使用AsyncTask
spring bean作用域
hdoj 1455 Sticks 【dfs】
POJ 1611 The Suspects(并查集)
HDU 5355 Cake (WA后AC代码,具体解析,构造题)