Run locust on single node or distributed on Databricks.
Project description
locust-on-databricks
Installation
pip install locust-on-databricks
Usage
OOTB Examples
For OOTB please look at examples in
The dummy example locustfile is here: locustfile.py
API Usage
Construct the runner:
from lod import LocustRunner
runner = LocustRunner(
locustfile_path="locustfile.py", # path to your locustfile
# port=8089, # port is optional
)
Construct your initial swarm:
runner = runner.set_initial_swarm(
host="https://google.com",
user_count=10,
spawn_rate=2,
# run_time = "5m"
)
Start your locust server:
runner.start_locust()
Stop your locust server:
runner.stop_locust()
Search for "Access Locust Web UI at" in the output and open the link in your browser.
Distributed Runner
Construct a distributed runner:
runner = runner
.distributed()
.set_initial_swarm(
host="https://google.com",
user_count=10,
spawn_rate=2,
# run_time = "5m"
)
Construct a distributed runner with custom worker to core ratio:
runner = runner
.distributed(process_to_core_count_ratio=2.0)
.set_initial_swarm(
host="https://google.com",
user_count=10,
spawn_rate=2,
# run_time = "5m"
)
process_to_core_count_ratio is defaulted to 2 and it will spin up twice the number of workers as you have cores.
You can tweak this as needed.
Run and stop new swarms
Run a new swarm:
runner.run_swarm(
host="https://google.com",
user_count=10,
spawn_rate=2,
# run_time = "5m"
)
Stop a running swarm
runner.stop_swarm()
Limitations
Starting a new swarm in the ui is bugged and the swarm rest api from the ui is not working.
Disclaimer
locust-on-databricks is not developed, endorsed not supported by Databricks. It is provided as-is; no warranty is derived from using this package. For more details, please refer to the license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file locust-on-databricks-0.1.1.tar.gz.
File metadata
- Download URL: locust-on-databricks-0.1.1.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c0649fecd3d98ac15de8b9276a78e4a1efc4471c192c4c6ca456433d02e6638
|
|
| MD5 |
dbb65c632e00ec119b64983bbcba280b
|
|
| BLAKE2b-256 |
742da83ae1dc8be5bd34c044614958bdafa9eb65c716e4de91693accf949b1df
|
File details
Details for the file locust_on_databricks-0.1.1-py3-none-any.whl.
File metadata
- Download URL: locust_on_databricks-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be01409420df9cdb8be9e336b694b5076d3b049ad65905b41abcb34c151b0966
|
|
| MD5 |
ea77f4f55d18ed7405b3e02f108d7c7b
|
|
| BLAKE2b-256 |
512e8dddd1b4041556cddcc6fd63286f6388aeb6f9dd8556d24d176c2734d042
|