This flowchart illustrates the architecture of LoadDensity, a performance testing framework, detailing its entry points, action execution, protocol handlin
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 outlines the architecture of the LoadDensity performance testing framework. It starts with various entry interfaces (CLI, MCP Server, GUI, Control Socket) that feed action JSON to an Action Executor. This executor dispatches actions to a locust_wrapper_proxy, which then handles different protocols such as HTTP, WebSocket, gRPC, MQTT, and Raw TCP/UDP. All protocol interactions generate Locust Events, which are channeled into a central Locust Event Bus. From the bus, data flows to a test_record_instance for generating diverse reports (HTML, JSON, XML, CSV, JUnit, Summary) and to external monitoring systems like Prometheus, InfluxDB, or OTel for metrics. Additionally, test records are persisted in SQLite for cross-comparison.
Use this architecture for designing or understanding performance testing frameworks that require multi-protocol support, integration with Locust, and comprehensive reporting and monitoring. It's ideal for building scalable and extensible load testing solutions for various application types.
This architecture can be adapted by integrating new communication protocols (e.g., Kafka, AMQP) into the wrapper proxy, replacing the Locust Event Bus with a custom event system, or connecting to different monitoring and reporting platforms. The SQLite persistence layer can be swapped for other database solutions for enhanced scalability or specific data retention policies.