Locust Cloud Client

1.30.0 · deprecated · verified Fri Apr 10

Locust Cloud is a Python library that acted as a client for the now-defunct Locust Cloud service, enabling users to deploy and manage distributed Locust load tests on a hosted cloud platform. The underlying Locust Cloud service has been shut down. The library's latest version is 1.30.0, and it follows the release cadence of its primary dependency, Locust, though its utility is now limited due to the service discontinuation.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a typical Locust test script (`my_locustfile.py`) that would have been used with the `locust-cloud` extension. The `locust-cloud` library extended the standard `locust` command with a `--cloud` flag to deploy these tests to the hosted service. Note the use of environment variables for non-interactive authentication for CI/CD scenarios.

# my_locustfile.py
from locust import HttpUser, task, between

class WebsiteUser(HttpUser):
    wait_time = between(1, 2)
    host = "http://127.0.0.1:8089" # Or a mock server provided by Locust Cloud

    @task
    def index_page(self):
        self.client.get("/")

    @task(3)
    def view_items(self):
        for item_id in range(10):
            self.client.get(f"/item?id={item_id}", name="/item")

# To have run this with Locust Cloud (before its shutdown):
# 1. Ensure you have Locust Cloud credentials configured (e.g., via `locust --cloud --login` or environment variables).
# 2. Run your test:
#    LOCUSTCLOUD_USERNAME=os.environ.get('LOCUSTCLOUD_USERNAME', '') \
#    LOCUSTCLOUD_PASSWORD=os.environ.get('LOCUSTCLOUD_PASSWORD', '') \
#    LOCUSTCLOUD_REGION=os.environ.get('LOCUSTCLOUD_REGION', 'us-east-1') \
#    locust --cloud -f my_locustfile.py --headless --users 10 --spawn-rate 1

view raw JSON →