locust 官网文档地址:https://docs.locust.io/en/stable/configuration.html

Locust QQ 群:

执行命令如:

master:

locust -f D:\api_locust\fm_api\locust_api\***x.py --master --master-bind-port 9800 --headless -u 500 -r 200 --expect-workers 10 -t 1m -s 5 --csv D:\locustlog\

slave:

locust -f D:\api_locust\fm_api\locust_api\***x.py --master-host localhost --master-port 9800 --headless --worker

详细参数:

Command line Configfile Description 中文对照
-f, --locustfile locustfile

Python module file to import,

e.g. ‘../other.py’. Default: locustfile

需要执行脚本的文件及路径
-H, --host host

Host to load test in the following

format: http://10.21.32.33

压测主机的host
-u, --users users

Number of concurrent Locust users.

Only used together with –headless

压测并发用户数,

只能与-headless参数一起使用

-r, --hatch-rate hatch-rate

The rate per second in which users are spawned.

Only used together with –headless

每秒启动用户数,

仅与–headless一起使用

-t, --run-time run-time

Stop after the specified amount of time,

e.g. (300s, 20m, 3h, 1h30m, etc.).

Only used together with –headless

压测执行时间,

仅与–headless一起使用

--web-host web-host

Host to bind the web interface to.

Defaults to ‘*’ (all interfaces)

网页上执行压测的host,

默认为*

--web-port, -P web-port Port on which to run web host 网页上执行压测的端口
--headless headless

Disable the web interface,

and instead start the load test immediately.

Requires -u and -t to be specified.

不支持网页压测,需要指定

-u,-t参数一起使用

--web-auth web-auth

Turn on Basic Auth for the web interface.

Should be supplied in the following

format: username:password

网页执行压测认证,

格式为:username:password

--tls-cert tls-cert

Optional path to TLS certificate to

use to serve over HTTPS

通过HTTPS服务的TLS证书的路径
--tls-key tls-key

Optional path to TLS private key to

use to serve over HTTPS

通过HTTPS服务的TLS私钥的路径
--master master

Set locust to run in distributed mode

with this process as master

分布式运行的master进程
--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进程运行的host,

默认为*,只能与-master一起使用

--master-bind-port master-bind-port

Port that locust master should bind to.

Only used when running with –master.

Defaults to 5557

master进程运行的端口,

默认为5557,只能与-master一起使用

--expect-workers expect-workers

How many workers master should expect

to connect before starting the test

(only when –headless used).

分布式压测的slave个数,

只能与–headless参数一起使用

--worker worker

Set locust to run in distributed mode

with this process as worker

slave压测进程
--master-host master-host

Host or IP address of locust master for

distributed load testing.

Only used when running

with –worker. Defaults to 127.0.0.1.

salve压测进程配置的master进程的host,

只能与-worker一起使用

--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

–worker. Defaults to 5557.

salve压测进程配置的master进程的端口,

默认为5557,只能与-worker一起使用

-T, --tags tags

List of tags to include in the test,

so only tasks with any matching tags will be executed

需要被执行的标签
-E, --exclude-tags exclude-tags

List of tags to exclude from the test,

so only tasks with no matching tags will be executed

需要被过滤的标签
--csv csv

Store current request stats to files in CSV format.

Setting this option will generate three files:

[CSV_PREFIX]_stats.csv,

[CSV_PREFIX]_stats_history.csv ,

[CSV_PREFIX]_failures.csv

将请求的统计数据存到csv文件里,

该参数会保存三个csv文件

--csv-full-history csv-full-history

Store each stats entry in CSV

format to _stats_history.csv file

将每个统计条目存

到 _stats_history.csv 文件

--print-stats print-stats Print stats in the console 在控制台中打印统计信息
--only-summary only-summary Only print the summary stats 只打印汇总统计
--reset-stats reset-stats

Reset statistics once hatching has been completed.

should be set on both master and workers

when running in distributed mode

重置统计信息,master和slave

同时设置才生效

--skip-log-setup skip-log-setup

Disable Locust’s logging setup. Instead,

the configuration is provided by the

Locust test or Python defaults.

禁用日志
--loglevel, -L loglevel

Choose between

DEBUG/INFO/WARNING/ERROR/CRITICAL.

Default is INFO.

记录日志级别,默认info
--logfile logfile Path to log file. If not set, log will go to stdout/stderr 日志记录目录,默认在/stdout/stderr
--step-load step-load

Enable Step Load mode to monitor how performance

metrics varies when user load increases.

Requires –step-users and –step-time to be specified.

分布式压测逐步增加模式
--step-users step-users

User count to increase by step in Step Load mode.

Only used together with –step-load

逐步增加的用户数,

只能和--step-load参数使用

--step-time step-time

Step duration in Step Load mode,

e.g. (300s, 20m, 3h, 1h30m, etc.).

Only used together with –step-load

逐步增加的压测时长,

只能和--step-load参数使用

--exit-code-on-error exit-code-on-error

Sets the process exit code to use

when a test result contain any failure or error

配置退出执行标签,

当程序执行出错包含这个标签时

-s, --stop-timeout stop-timeout

Number of seconds to wait for a simulated

user to complete any executing task before exiting.

Default is to terminate immediately.

This parameter only needs to be specified for the

master process when running Locust distributed.

设置等待模拟用户完成任务时间,

默认立即退出

仅供参考,翻译不准确的参考官网~

locust常用的配置参数【locust版本:V1.1.1】的更多相关文章

  1. 常用JVM配置参数

    常用JVM配置参数 Trace跟踪参数 堆的分配参数 栈的分配参数 Trace跟踪参数 1.打开GC的日志,如果在程序的运行过程中,系统发生了GC,就会打印相关的信息. -verbose:gc -XX ...

  2. JVM虚拟机(1)---常用JVM配置参数

    常用JVM配置参数 常用JVM配置参数主要有:Trace跟踪参数.堆的分配参数.栈的分配参数. 一.Trace跟踪参数 跟踪参数用于跟踪监控JVM,对于开发人员来讲用于JVM调优以及故障排查的. 1. ...

  3. JVM学习八:常用JVM配置参数

    前面学习的都是和类加载相关的知识,接下来学习的则和GC相关的知识,都是JVM的几个重点块. 零.在IDE的后台打印GC日志: 既然学习JVM,阅读GC日志是处理Java虚拟机内存问题的基础技能,它只是 ...

  4. 天地图常用WMTS配置参数

    wmts常用参数 var matrixIds = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', ...

  5. Java虚拟机详解----常用JVM配置参数

    本文主要内容: Trace跟踪参数 堆的分配参数 栈的分配参数 零.在IDE的后台打印GC日志: 既然学习JVM,阅读GC日志是处理Java虚拟机内存问题的基础技能,它只是一些人为确定的规则,没有太多 ...

  6. 【转】Java虚拟机详解----常用JVM配置参数

    原文地址:http://www.cnblogs.com/smyhvae/p/4736162.html 本文主要内容: Trace跟踪参数 堆的分配参数 栈的分配参数 零.在IDE的后台打印GC日志: ...

  7. JVM学习一:常用JVM配置参数

    原文链接:https://www.cnblogs.com/pony1223/p/8661219.html 在IDE的后台打印GC日志: 既然学习JVM,阅读GC日志是处理Java虚拟机内存问题的基础技 ...

  8. Java虚拟机(四):常用JVM配置参数

    一.VM选项 - : 标准VM选项,VM规范的选项 -X: 非标准VM选项,不保证所有VM支持 -XX: 高级选项,高级特性,但属于不稳定的选项 参见Java HotSpot VM Options 二 ...

  9. JVM内核-原理、诊断与优化学习笔记(三):常用JVM配置参数

    文章目录 Trace跟踪参数 -verbose:gc (打开gc的跟踪情况) -XX:+printGC(打开gc的log开关,如果在运行的过程中出现了gc,就会打印出相关的信息.) -XX:+Prin ...

  10. 深入JVM内核--常用JVM配置参数

    Trace跟踪参数 -verbose:gc -XX:+printGC 可以打印GC的简要信息 [GC 4790K->374K(15872K), 0.0001606 secs] [GC 4790K ...

随机推荐

  1. elementPlus使用el-icon

    按着文档来撒 yarn add @element-plus/icons-vue main.ts import * as ElementIcons from '@element-plus/icons-v ...

  2. liunx 设置默认python版本方法,

    Linux 中把Python3设为默认Python版本的几种方法 由于工作中要用到到python3.6  而服务器是2.7 ,这个低版本的2.7很多系统都要依赖,还不能删,同事建议建一个虚拟环境,但是 ...

  3. Dot Log 插件 输入 .log 回车 自动插入 console.log - vscode插件

    Dot Log 插件 输入 .log 回车 自动插入 console.log

  4. pcm5102芯片解析之基本概念

    一 前记 1 在音频领域深耕,那就要不断的前行.最近有几个项目需要用到pcm5102这颗料,藉此机会,针对这个料进行深入的研究一下.做一一些简要的分析. 二 概念 音频芯片的指标,其实,很多年都没啥变 ...

  5. git clone error: RPC failed; curl 18 transfer closed with outstanding read data remaining

    备忘 git clone比较大的工程时,出现这种错误:error: RPC failed; curl 18 transfer closed with outstanding read data rem ...

  6. 性能优化:编译器优化选项 -O2/-O3 究竟有多强大?

    之前的"性能优化的一般策略及方法"一文中介绍了多种性能优化的方法.根据以往的项目经验,开启编译器优化选项可能是立竿见影.成本最低.效果最好的方式了. 这么说可能还不够直观,举个真实 ...

  7. 记录--详解 XSS(跨站脚本攻击)

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 前言:我们知道同源策略可以隔离各个站点之间的 DOM 交互.页面数据和网络通信,虽然严格的同源策略会带来更多的安全,但是也束缚了 Web. ...

  8. 记录--关于无感刷新Token,我是这样子做的

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 什么是JWT JWT是全称是JSON WEB TOKEN,是一个开放标准,用于将各方数据信息作为JSON格式进行对象传递,可以对数据进行可 ...

  9. drools执行String规则或执行某个规则文件

    1.背景 此处主要记录一下2个小的知识点,防止以后忘记. 1.如何在drools中执行某个drl文件. 2.如果我们的规则是一个String类型的字符串,那么该如何执行. 2.实现 2.1 执行指定的 ...

  10. mysql数据库锁MDL锁的解释

    1.背景 在我们系统中有一张表它的查询概率非常高.最近有个需求,需要对这个表增加一个字段,然而在增加字段的时候发现系统中有多个业务出现了超时操作,那么这个是什么原因导致的呢?经过查阅资料发现是数据库的 ...