This flowchart illustrates the architecture of LoadDensity, a load testing tool, detailing its input interfaces, action execution, multi-protocol support,
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 presents the architecture of the LoadDensity load testing framework. It shows how various entry interfaces (CLI, MCP Server, GUI, Control Socket) feed "動作 JSON" (action JSON) to an "動作 Executor" (Action Executor). The executor dispatches actions to a `locust_wrapper_proxy`, which handles different protocols like HTTP, WebSocket, gRPC, MQTT, and Raw TCP/UDP. All protocol interactions feed into a "Locust Event Bus," which then directs data to a "test_record_instance" for reports (HTML, JSON, XML, CSV, JUnit, Summary) and SQLite persistence, as well as to external metrics systems like Prometheus, InfluxDB, and OpenTelemetry.
Use this diagram to understand the internal flow and components of a comprehensive load testing system, to design a similar performance testing framework, or to identify integration points for custom protocols, metrics, or reporting.
This architecture can be adapted by adding new protocol handlers (e.g., Kafka, database protocols), integrating with different distributed testing orchestrators, extending the reporting capabilities with custom formats, or incorporating advanced monitoring and alerting systems beyond basic metrics.