locust

Locust is an easy to use, scriptable and scalable Python-based performance testing tool

Options

NameDescription
-v, --versionShow program's version number and exit
-h, --helpShow this help message and exit
-f, --locustfile <files......>Show program's version number and exit
--config <files......>Config file path
-H, --hostHost to load test in the following format: http://10.21.32.33
-u, --usersPeak number of concurrent Locust users. Primarily used together with --headless or --autostart
-r, --spawn-rateRate to spawn users at (users per second). Primarily used together with --headless or --autostart
-t, --run-timeStop after the specified amount of time, e.g. (300s, 20m, 3h, 1h30m, etc.)
-l, --listShow list of possible User classes and exit
--web-hostHost to bind the web interface to. Defaults to '*' (all interfaces)
-P, --web-portPort on which to run web host
--headlessDisable the web interface, and start the test immediately
--autostartStarts the test immediately (without disabling the web UI)
--autoquitQuits Locust entirely, X seconds after the run is finished
--web-authTurn on Basic Auth for the web interface. e.g. username:password
--tls-cert <tls-cert>Optional path to TLS certificate to use to serve over HTTPS
--tls-key <tls-key>Optional path to TLS private key to use to serve over HTTPS
--class-pickerEnable select boxes in the web interface to choose from all available User classes and Shape classes
--masterSet locust to run in distributed mode with this process as master
--master-bind-hostInterfaces (hostname, ip) that locust master should bind to
--master-bind-portPort that locust master should bind to
--expect-workersHow many workers master should expect to connect before starting the test (only when --headless/autostart is used)
--expect-workers-max-waitHow long should the master wait for workers to connect before giving up. Defaults to wait forever
--workerSet locust to run in distributed mode with this process as worker
--master-hostHost or IP address of locust master for distributed load testing. Only used when running with --worker. Defaults to 127.0.0.1
--master-portShow list of possible User classes and exit
--csvStore current request stats to files in CSV format
--csv-full-historyStore each stats entry in CSV format to _stats_history.csv file. You must also specify the '--csv' argument to enable this
--print-statsPrint stats in the console
--only-summaryOnly print the summary stats
--reset-statsReset statistics once spawning has been completed. Should be set on both master and workers when running in distributed mode
--htmlStore HTML report to file path specified
--skip-log-setupDisable Locust's logging setup. Instead, the configuration is provided by the Locust test or Python defaults. --loglevel LOGLEVEL, -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 stderr
--show-task-ratioPrint table of the User classes' task execution ratio. Use this with non-zero --user option if some classes define non-zero fixed_count attribute
--show-task-ratio-jsonPrint json data of the User classes' task execution ratio. Use this with non-zero --user option if some classes define non-zero fixed_count attribute
--exit-code-on-errorSets the process exit code to use when a test result contain any failure or error
--equal-weightsUse equally distributed task weights, overriding the weights specified in the locustfile
--enable-rebalancingAllow to automatically rebalance users if new workers are added or removed during a test run
-T, --tagsList of tags to include in the test, so only tasks with any matching tags will be executed
--E, --exclude-tagsList of tags to exclude from the test, so only tasks with no matching tags will be executed