Registry / testing / locust-plugins

locust-plugins

JSON →
library5.0.3pypypi✓ verified 23d ago

Locust Plugins is a collection of useful extensions for Locust, the open-source load testing tool. It provides implementations for various non-HTTP protocols like Playwright, Selenium/Webdriver, Kafka, FTP, and Telnet 3270, as well as enhanced reporting capabilities for TimescaleDB, Grafana, and Azure Application Insights. The library is currently at version 5.0.0 and maintains an active development cycle, often aligning with updates to Locust core.

pip install locust-plugins
INSTALL
IMPORT
SIG · LOCUST-PLUGINS
L
locust-plugins
testingpythonv5.0.3
Install
12.7s avg
Import
1710ms
Disk
75MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
1/2 runs
✓ 14.6s
py 3.11
1/2 runs
✓ 13.4s
py 3.12
1/2 runs
✓ 11.45s
py 3.13
1/2 runs
✓ 11.45s
py 3.9
✕ build_error
✕ build_error
75MB installed
● package 75MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PlaywrightUser
from locust_plugins.users.playwright import PlaywrightUser
Timescale
from locust_plugins.listeners.timescale import Timescale
ApplicationInsights
from locust_plugins.listeners.appinsights import ApplicationInsights
FtpUser
from locust_plugins.users.ftpuser import FtpUser
MqttUser
from locust.contrib.mqtt import MqttUser
from locust_plugins.users.mqttuser import MqttUser
MqttUser was moved into Locust core in locust-plugins 5.0.0 and Locust 2.41.0. Import directly from `locust.contrib.mqtt` instead.
SocketIOUser
from locust.contrib.socketio import SocketIOUser
from locust_plugins.users.socketio import SocketIOUser
SocketIOUser was moved into Locust core in locust-plugins 5.0.0 and Locust 2.39.0. Import directly from `locust.contrib.socketio` instead.
RestUser
from locust.contrib.rest import RestUser
from locust_plugins.users.restuser import RestUser
RestUser was moved into Locust core in locust-plugins 5.0.0. Import directly from `locust.contrib.rest` instead.

This quickstart demonstrates a basic PlaywrightUser, launching a browser, navigating to Google, performing a search, and taking a screenshot. It then manually fires a request event for Locust statistics.

from locust import task, between from locust_plugins.users.playwright import PlaywrightUser class MyPlaywrightUser(PlaywrightUser): host = "https://www.google.com" wait_time = between(2, 5) @task async def search_for_locust(self): page = self.page # Access the Playwright page object await page.goto(self.host) await page.fill('textarea[name="q"]', "Locust load testing") await page.press('textarea[name="q"]', 'Enter') await page.wait_for_selector("#search"); # Wait for search results await page.screenshot(path="locust_search.png") self.environment.events.request.fire( request_type="Playwright", name="/search", response_time=1000, # Dummy response time response_length=100, context={ "user": self.id }, exception=None, )
Debug
Known issues
breakingAs of `locust-plugins` version 5.0.0, the `MqttUser`, `SocketIOUser`, and `RestUser` classes have been removed from this library. They are now part of Locust core.
fix
Update your imports to `from locust.contrib.mqtt import MqttUser`, `from locust.contrib.socketio import SocketIOUser`, and `from locust.contrib.rest import RestUser` respectively. Ensure your Locust version is compatible (Locust 2.41.0+ for MqttUser, 2.39.0+ for SocketIOUser).
affects: >=5.0.0
breakingThe `--profile` command-line argument was removed in `locust-plugins` 4.7.0. It has been integrated into Locust core functionality.
fix
Refer to the official Locust documentation for the updated `--profile` argument usage directly within Locust.
affects: >=4.7.0
gotchaUser types like `PlaywrightUser` and `WebdriverUser` (Selenium) are resource-intensive. Running too many concurrent browser instances per worker can lead to high CPU usage and degraded performance.
fix
Optimize tests by blocking unnecessary resources (e.g., images, third-party scripts). Scale by using more Locust worker instances across multiple machines instead of increasing the number of users per worker (e.g., limit to 4-5 browser users per worker).
affects: All
gotchaWhen implementing custom non-HTTP User classes (or using older versions of `SocketIOUser`), avoid directly calling blocking receive methods (e.g., `self.ws.recv()`).
fix
Instead, implement event-driven callbacks (e.g., `on_message()`) to handle incoming data. This aligns with Locust's gevent-based concurrency model and prevents blocking the entire worker process.
affects: All (conceptual)
gotchaFor logging and graphing results using TimescaleDB and Grafana, ensure you configure the `--timescale` argument when running Locust and have a TimescaleDB instance set up.
fix
Follow the setup instructions in the `locust-plugins` documentation for Timescale/Grafana integration, typically involving `docker-compose` for a quick setup. Activate with `locust --timescale ...`
affects: All
Upgrade
Version history
5.0.3latest on PyPI · released Jun 12, 2026
Audit
Dependencies
locustrequiredCore dependency as it provides extensions for Locust.
pythonrequiredPython 3.10 or newer is required.
Agent activity
18 hits · last 30 days
node
14
OpenAI (training)
2
Amazon
1
Resources
locust-plugins — pip install locust-plugins · libregistry