Documentation
¶
Overview ¶
Command loadtest drives a bubbles server with many realtime clients and reports send-to-receive latency, message loss and server memory.
go run ./tools/loadtest --clients 200 --senders 20 --rate 5 --duration 60s \
--assert-p95 150ms --assert-rss 300MB
Without --url it builds ./cmd/bubbles into a temporary directory, starts it with a throwaway data directory on random loopback ports and tears it down afterwards. Every message carries its send timestamp in the body; receivers compute the latency from that timestamp (Unix nanoseconds, read from the same host clock). Latency is therefore only meaningful when the generator and the server run on one host; do not compare numbers taken across hosts. Loss is decided by comparing message-ID sets: every ID posted to a channel must appear in each subscribed client's set.
Seq gaps are not counted as loss. The seq is global and the server filters each replay and live event by visibility, so a client sees gaps by design. Only a seq that does not increase (a regression) is reported.