This diagram illustrates the LoadDensity architecture, a performance testing framework, detailing its entry points, action execution, multi-protocol suppor
flowchart TD
subgraph Entry["入口接口"]
CLI[CLI]
MCP[MCP Server]
GUI[GUI]
SOCK[控制 Socket]
end
Entry -- "动作 JSON" --> EXEC["动作 Executor<br/>(LD_* 派发 + 安全 builtin)"]
EXEC -- "start_test" --> WRAPPER["locust_wrapper_proxy<br/>(每协议 task store)"]
WRAPPER --> HTTP["HTTP / FastHttp"]
WRAPPER --> WS["WebSocket"]
WRAPPER --> GRPC["gRPC"]
WRAPPER --> MQTT["MQTT"]
WRAPPER --> RAW["原生 TCP / UDP"]
HTTP -- "Locust 事件" --> BUS([Locust Event Bus])
WS --> BUS
GRPC --> BUS
MQTT --> BUS
RAW --> BUS
BUS --> REC["test_record_instance"]
BUS --> METRICS["Prometheus / InfluxDB / OTel"]
REC --> REPORTS["HTML / JSON / XML / CSV / JUnit / Summary 报告"]
REC --> SQLITE[("SQLite 持久化<br/>(跨次比对)")]
The diagram shows the architectural flow of LoadDensity, starting from various entry interfaces like CLI, MCP Server, GUI, and Control Socket. These interfaces feed "action JSON" to an Action Executor, which dispatches tasks and handles built-in security. The executor then interacts with a locust_wrapper_proxy that manages tasks for different protocols (HTTP, WebSocket, gRPC, MQTT, Raw TCP/UDP). All protocol interactions feed into a central Locust Event Bus, which then routes data to a test_record_instance for persistence (SQLite) and various reports (HTML, JSON, XML, CSV, JUnit, Summary), as well as to external metrics systems like Prometheus, InfluxDB, or OTel.
Use this diagram to understand the internal workings of a comprehensive load testing framework, design a similar performance testing system, or identify integration points for custom protocols, reporting, or monitoring in a DevOps pipeline.
This architecture can be adapted by adding new protocol handlers to the locust_wrapper_proxy, integrating different event bus implementations, extending the test_record_instance for custom data persistence, or connecting to alternative monitoring and reporting tools beyond Prometheus, InfluxDB, or OTel. New entry interfaces can also be introduced.