{"id":2581,"library":"locust-cloud","title":"Locust Cloud Client","description":"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.","status":"deprecated","version":"1.30.0","language":"en","source_language":"en","source_url":"https://github.com/locustcloud/locust-cloud","tags":["load testing","performance testing","cloud","locust","deprecated"],"install":[{"cmd":"pip install locust-cloud","lang":"bash","label":"Install `locust-cloud` (now deprecated)"},{"cmd":"pip install locust","lang":"bash","label":"Install core Locust (recommended alternative)"}],"dependencies":[{"reason":"`locust-cloud` is an extension for the Locust load testing framework. While not a direct PyPI dependency for `locust-cloud` itself, `locust` is required for defining and running actual load tests.","package":"locust","optional":false}],"imports":[{"note":"The `locust-cloud` library primarily extends the `locust` CLI. User-defined load test logic (e.g., HttpUser, TaskSet, task decorators) is imported directly from the `locust` library, not `locust_cloud`.","symbol":"HttpUser","correct":"from locust import HttpUser, task"},{"note":"The `locust-cloud` library does not expose typical Python symbols for direct import and usage within a user's Python code (like `run_test_locally`). Its functionality is accessed via the `locust --cloud` CLI flag.","symbol":"run_test_locally","correct":"This library primarily extends the 'locust' command-line interface."}],"quickstart":{"code":"# my_locustfile.py\nfrom locust import HttpUser, task, between\n\nclass WebsiteUser(HttpUser):\n    wait_time = between(1, 2)\n    host = \"http://127.0.0.1:8089\" # Or a mock server provided by Locust Cloud\n\n    @task\n    def index_page(self):\n        self.client.get(\"/\")\n\n    @task(3)\n    def view_items(self):\n        for item_id in range(10):\n            self.client.get(f\"/item?id={item_id}\", name=\"/item\")\n\n# To have run this with Locust Cloud (before its shutdown):\n# 1. Ensure you have Locust Cloud credentials configured (e.g., via `locust --cloud --login` or environment variables).\n# 2. Run your test:\n#    LOCUSTCLOUD_USERNAME=os.environ.get('LOCUSTCLOUD_USERNAME', '') \\\n#    LOCUSTCLOUD_PASSWORD=os.environ.get('LOCUSTCLOUD_PASSWORD', '') \\\n#    LOCUSTCLOUD_REGION=os.environ.get('LOCUSTCLOUD_REGION', 'us-east-1') \\\n#    locust --cloud -f my_locustfile.py --headless --users 10 --spawn-rate 1","lang":"python","description":"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."},"warnings":[{"fix":"Migrate your load testing infrastructure to self-hosted open-source Locust, which continues to be actively developed and maintained. The core Locust project can be found at https://locust.io and installed via `pip install locust`.","message":"The Locust Cloud service, for which this library acts as a client, has been officially shut down. This means the primary functionality of `locust-cloud` (deploying and running tests on the hosted platform) is no longer operational.","severity":"breaking","affected_versions":"All versions"},{"fix":"Discontinue use of `locust-cloud`. Focus on the core `locust` library for all new and existing load testing requirements.","message":"The `locust-cloud` library is deprecated due to the shutdown of its dependent service. No further development or support is expected for this client library.","severity":"deprecated","affected_versions":"All versions"},{"fix":"Always import `HttpUser`, `task`, `between`, etc., from the `locust` package in your test scripts. The `locust-cloud` functionality was invoked via `locust --cloud ...`.","message":"This library acts as a command-line interface (CLI) extension to the main `locust` command. It does not provide Python modules for direct programmatic import into your test scripts beyond what the core `locust` library offers. Your `locustfile.py` should only import from `locust`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}