Documentation
¶
Overview ¶
Package main implements a full-stack, end-to-end load test for RUSEON Core.
All layers run in-process for accurate, reproducible benchmarking:
- Ingest : Synthetic cameras feed H.264 frames (I-frames & P-frames) directly into stream.Manager at 30 FPS.
- REST API : Concurrent workers query Gin router (/api/cameras, /api/stats, /api/tags, /api/folders) exercising JWT auth, metrics aggregation and JSON serialization.
- HLS fMP4 : Viewers poll live playlists (/stream/hls/:id/stream.m3u8) and download generated video segments (/stream/hls/:id/segment_*.m4s & init.mp4).
- WebRTC (WHEP) : Clients establish real Pion WebRTC peer connections via WHEP SDP exchange and receive live RTP media packets.
- gRPC Extractor : Clients subscribe to StreamFrames (server-streaming) and push AI metadata via PushMetadata against a local gRPC server.
- EventBus : Floods system events (camera_offline, storage_warning); webhook sink exercises delivery and circuit breaker.
- Disk I/O : Optional real MP4 recording to local filesystem.
Usage:
go run ./cmd/loadtest \ -cameras=50 -hls-viewers=50 -webrtc-viewers=20 -api-workers=50 \ -grpc-pushers=10 -duration=30 -report-every=5 -output-json=bench.json -output-md=bench.md
Click to show internal directories.
Click to hide internal directories.