Foreword
When we use the tools on linux locust pressure measured, using a no-web pattern you will then need to collect the log run, easy to find the problem.
Command line parameters
Enter the locust --help to see all of the command line parameters
> 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
Parameter Description
parameter name | Parameter Value | Parameter Description |
---|---|---|
-h, --help | No arguments | View Help |
-H HOST, –host=HOST | HOST | Designated host are tested using the format: http://10.21.32.33 |
–web-host=WEB_HOST | WEB_HOST | The host is specified to run Locust Web page, the default is empty. " |
-P PORT, --port = PORT -web-port = PORT | PORT | Designated -web-host ports, the default is 8089 |
-f LOCUSTFILE, –locustfile=LOCUSTFILE | LOCUSTFILE | Locust Run performance tests specified file, the default is: locustfile.py |
–csv=CSVFILEBASE, –csv-base-name=CSVFILEBASE | CSVFILEBASE | CSV format stored test data for the current request. |
–master | No arguments | Locust distributed mode using the current node as master node. |
–slave | No arguments | Locust distributed mode uses the current node is a slave node. |
–master-host=MASTER_HOST | MASTER_HOST | Distributed mode, set the host or IP address of the master node, used only run with -slave node, by default: 127.0.0.1. |
–master-port=MASTER_PORT | MASTER_PORT | Distributed mode, setting master node port number, used only in the run with -slave node, default: 5557. Note that, slave node to the master node is also connected on this port +1. |
–master-bind-host=MASTER_BIND_HOST | MASTER_BIND_HOST | In doing distributed pressure measurement, a specific extension IP. Only for the master. If not specified, the default is all available IP (ie all IP hosts marked the slave) |
–master-bind-port=MASTER_BIND_PORT | MASTER_BIND_PORT | In doing distributed pressure measurement, a specific extension port. The default is 5557 and 5558. |
-no-web non-web | with -c and -r | Mode test, used in conjunction with -r and -c needs. |
-c NUM_CLIENTS, -clients = NUM_CLIENTS | NUM_CLIENTS | Specifies the number of concurrent users, acting -no-web pattern. |
-r HATCH_RATE, –hatch-rate=HATCH_RATE | HATCH_RATE | Specifies the number of users per start, acting on -no-web pattern. |
-t RUN_TIME, –run-time=RUN_TIME | RUN_TIME | Set run time, for example: (300s, 20m, 3h, 1h30m) acting -no-web pattern. |
-L LOGLEVEL, –loglevel=LOGLEVEL | LOGLEVEL | Select the log level (DEBUG / INFO / WARNING / ERROR / CRITICAL). The default is INFO. |
–logfile=LOGFILE | LOGFILE | Log file path. If not set, the log will go to stdout / stderr |
–print-stats | No arguments | Print data in the console |
–only-summary | No arguments | Print only summary statistics |
–no-reset-stats | No arguments | Do not reset statistics once hatching has been completed。 |
-l, –list | No arguments | Display test class configuration parameters -f |
–show-task-ratio | No arguments | Print locust task execution ratio test class, with the -f parameter. |
–show-task-ratio-json | No arguments | Performing a ratio test class locust json format print job, with the -f parameter. |
-V, –version | No arguments | Locust view the current version of the tool. |