How pouyarer/stormqa works
Purpose and Entry Points
StormQA is a Python load/chaos-testing package with a React dashboard. Its CLI supports GUI launch, HTTP load tests, WebSocket stress tests, network simulation, database endpoint testing, and report generation. The primary Python entry point is src/stormqa/main.py; the GUI server is src/stormqa/ui/app.py.
CLI Orchestration
src/stormqa/main.py is the control boundary for interactive and headless modes. It routes commands to test engines and reporting, making CLI execution suitable for CI/CD while open launches the local UI service.
HTTP Load and Scenario Engine
src/stormqa/core/loader.py is the core HTTP load-test stage. It is responsible for concurrent request execution and is the likely integration point for scenario inputs such as user count, data-driven substitutions, chaos settings, extraction/assertion logic, and live metrics.
Chaos and Network Simulation
src/stormqa/core/network_sim.py models adverse network behavior, including latency and intentional connection failure profiles. It forms a distinct fault-injection boundary that can be applied to HTTP execution rather than requiring changes to target systems.
WebSocket Stress Testing
src/stormqa/core/ws_engine.py provides the protocol-specific runtime for concurrent WebSocket connections, message exchange, and RTT-oriented measurements. It is invoked independently from HTTP loading through the CLI and represented separately in the UI.
Database Testing
src/stormqa/core/db_sim.py supports database-oriented discovery/flooding workflows exposed by the db command. This is a separate test mode from direct HTTP and WebSocket traffic, with its own target-discovery and execution concerns.
Persistence, Reporting, and Analysis
src/stormqa/core/history_manager.py persists run history, described as local SQLite-backed historical metrics. src/stormqa/reporters/main_reporter.py consumes the most recent or stored results to create the report/AI-analysis output. This separates execution-time metric collection from post-run interpretation and document generation.
Local React Dashboard
src/stormqa/ui/app.py bridges the Python package to the frontend. The React/Vite client begins at src/stormqa/ui/src/main.jsx and src/stormqa/ui/src/app.jsx; operational views are split by mode in src/stormqa/ui/src/components/Dashboard.jsx, LoadTest.jsx, WebSocketTest.jsx, NetworkTest.jsx, and DbTest.jsx. The UI is a local control and visualization layer over Python-managed test execution and persisted history, not a separate hosted application.
Main entry points: app.py UI service · app.jsx Dashboard application · main.py StormQA CLI · history_manager.py Run history
Components 15
CLI & orchestration
- StormQA CLI · Routes interactive and headless commands.
src/stormqa/main.py
Test runtimes
- HTTP load engine · Executes requests and integrates scenario and metric behavior.
src/stormqa/core/loader.py - Network simulator · Applies latency and connection-failure profiles.
src/stormqa/core/network_sim.py - WebSocket engine · Runs concurrent connections, messaging, and RTT measurements.
src/stormqa/core/ws_engine.py - Database simulator · Handles database discovery and flooding workflows.
src/stormqa/core/db_sim.py
History & reporting
- Run history · Persists historical run metrics locally.
src/stormqa/core/history_manager.py - Report & analysis · Creates reports and AI-analysis output from results.
src/stormqa/reporters/main_reporter.py
Local dashboard
- UI service · Bridges the local dashboard to package-managed execution and history.
src/stormqa/ui/app.py - React bootstrap
src/stormqa/ui/src/main.jsx - Dashboard application
src/stormqa/ui/src/app.jsx - History dashboard
src/stormqa/ui/src/components/Dashboard.jsx - Load-test view
src/stormqa/ui/src/components/LoadTest.jsx - WebSocket view
src/stormqa/ui/src/components/WebSocketTest.jsx - Network-test view
src/stormqa/ui/src/components/NetworkTest.jsx - Database-test view
src/stormqa/ui/src/components/DbTest.jsx
Connections 22
- StormQA CLI → HTTP load engine: load command
- StormQA CLI → WebSocket engine: WebSocket command
- StormQA CLI → Database simulator: db command
- StormQA CLI → Report & analysis: report command
- StormQA CLI → UI service: open command
- HTTP load engine → Network simulator: injects network faults
- HTTP load engine → Run history: stores run metrics
- WebSocket engine → Run history: stores measurements
- Database simulator → Run history: stores run metrics
- Run history → Report & analysis: stored results
- React bootstrap → Dashboard application: mounts
- Dashboard application → History dashboard: renders
- Dashboard application → Load-test view: renders
- Dashboard application → WebSocket view: renders
- Dashboard application → Network-test view: renders
- Dashboard application → Database-test view: renders
- UI service → React bootstrap: serves local client
- History dashboard → UI service: reads history
- Load-test view → UI service: controls HTTP runs
- WebSocket view → UI service: controls WebSocket runs
- Network-test view → UI service: configures fault tests
- Database-test view → UI service: controls database runs