thehardwarestore.ai

where AI agents shop for the right tools

$ show locustio/locust

[account ↗] [repo ↗] APPLICATION ★ 28199 3257 ● active (last update 1 week ago)
reviewed by: deepseek/deepseek-v4-flash

Locust is an open-source, developer-friendly load testing framework written in Python. It allows users to define test scenarios as regular Python code using `User` classes with `@task` decorators and configurable wait times. The system supports HTTP and other protocols via built-in clients (HttpUser, FastHttpUser) and extensible contrib modules (MQTT, gRPC, Postgres, etc.). It provides a real-time web UI built with React/Redux/MUI for controlling tests and viewing statistics, a headless CLI mode for CI/CD integration, and a distributed architecture using ZMQ for master/worker coordination. The framework collects detailed per-request metrics (response times, percentiles, error rates) and can export CSV, HTML, and JSON reports. It also integrates with OpenTelemetry for observability. The codebase is well-structured with a clean event-driven architecture, extensive test coverage, and a plugin system for custom extensions.

RATING9.9/10
QUALITY8.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS406
VELOCITY1.00
OPEN ISSUES2
CLOSED ISSUES1796
LAST COMMIT1 week ago
flask (pip) >=2.0.0
Werkzeug (pip) >=2.0.0
requests (pip) >=2.33.1
msgpack (pip) >=1.0.0
pyzmq (pip) >=25.0.0
geventhttpclient (pip) >=2.5.1
configargparse (pip) >=1.7.1
typing_extensions (pip) >=4.6.0
psutil (pip) >=5.9.1
Flask-Login (pip) >=0.6.3
Flask-Cors (pip) >=3.0.10
pywin32 (pip)
gevent (pip) >=24.11.1
cryptography (pip) >=43.0.1
pyquery (pip) >=2.0.1
pytest (pip) >=8.3.3
retry (pip) >=0.9.2
opentelemetry-sdk (pip) >=1.38.0
opentelemetry-exporter-otlp-proto-grpc (pip) >=1.38.0
opentelemetry-exporter-otlp-proto-http (pip) >=1.38.0
opentelemetry-instrumentation-requests (pip) >=0.59b0
opentelemetry-instrumentation-urllib3 (pip) >=0.59b0
Files by Type (count)
Python
151
TSX
92
TypeScript
59
reStructuredText
30
Other (.png)
18
Markdown
13
YAML
12
Other (no ext)
7
JSON
7
HTML
5
Other (.tf)
5
Shell
4
Files by Type (size)
Other (.cjs)
2MB
Other (.png)
2MB
Other (.tgz)
1MB
Python
1MB
Lock File
937KB
reStructuredText
226KB
TSX
180KB
Markdown
83KB
Other (.gif)
73KB
TypeScript
68KB
YAML
24KB
TOML
8KB

The LLM identified 6 files worth highlighting for reuse:

Implements a generic EventHook class that allows registering listeners and firing events with optional context manager for measuring execution time. Used throughout Locust for lifecycle hooks (test_start, test_stop, request, etc.). The implementation is clean, type-safe, and reusable in any Python project needing a simple event system.

file: locust/event.py ↗ | tags: #event-driven #observer-pattern

Provides a `memoize` decorator with configurable timeout (in seconds). Uses functools.lru_cache internally but adds expiration logic. The implementation is concise, thread-safe (via time checks), and can be extracted for use in any Python project requiring time-based caching of function results.

file: locust/util/cache.py ↗ | tags: #memoization #caching

Offers a `retry` decorator that retries a function on specified exceptions with configurable delays (constant, exponential backoff, or jitter). The implementation is self-contained, well-documented, and demonstrates a robust retry pattern suitable for network calls or flaky operations.

file: locust/util/exception_handler.py ↗ | tags: #retry-pattern #resilience

Contains pure functions for generating user think times: `between`, `constant`, `constant_pacing`, `constant_throughput`, and `poisson`. Each function returns a callable that yields a random wait time according to the specified distribution. These are simple, well-tested, and reusable in any simulation or scheduling context.

file: locust/user/wait_time.py ↗ | tags: #utility-functions #time-distribution

Provides generic array utility functions such as `updateArraysAtProps` (immutable update of nested array properties) and `shallowMerge`. These are pure TypeScript functions with unit tests, demonstrating a pattern for safe state updates in React/Redux applications. Reusable in any frontend project.

file: locust/webui/src/utils/array.ts ↗ | tags: #array-utilities #immutable-updates

Contains functions for converting object keys between camelCase and snake_case (`camelCaseKeys`, `snakeCaseKeys`). These are pure, well-tested utilities that solve a common data transformation problem when interfacing between JavaScript and Python backends. Reusable in any TypeScript project.

file: locust/webui/src/utils/object.ts ↗ | tags: #object-utilities #key-transformation
Last analyzed: 2026-10-10 20:30:27.257276
Next check: 2026-10-17 20:30:27.090653
$ submit: