Skip to content

feat: report per-connection status in transport stats - #109

Merged
nange merged 3 commits into
masterfrom
feat/conns-status
Aug 19, 2026
Merged

feat: report per-connection status in transport stats#109
nange merged 3 commits into
masterfrom
feat/conns-status

Conversation

@nange

@nange nange commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

Add a new conns_status field to the client transport stats (exposed via /stats JSON and the periodic [STATS] log) describing the health of each underlying HTTP/2 connection.

The value is an array-like string, one element per live connection:

"[0:3:degraded, 1:2:expiring, 2:1:active, 3:1:heavy]"

Each element is <connection index>:<active streams>:<status>, where status is one of:

  • active — no special flags (healthy)
  • heavy — hosts at least one heavy stream
  • degraded — persistently low throughput confirmed by the health loop/probe
  • expiring — connection exceeded lifetime/bytes limit, awaiting rotation

Multiple flags are joined with + (e.g. heavy+expiring) so no state is hidden. Entries are sorted by stable connection index; an empty pool renders as []. Server-side snapshots omit the field (omitempty).

Changes

  • transport/transport.go: add ConnsStatus to TransportStats (json:"conns_status,omitempty")
  • transport/http2/client.go: populate the field in Stats() via new slotStatus/slotStatusString helpers
  • transport/http2/slot.go: add stable idx to transportSlot (retire swap-removes scramble live order)
  • cmd/easyss/main.go: log conns_status in the periodic [STATS] line
  • transport/http2/slot_status_test.go: unit tests for status derivation and rendering

Tests

  • go test ./transport/... ./stats/... pass
  • go build ./... pass
  • golangci-lint: 0 issues

@nange
nange merged commit d7d3464 into master Aug 19, 2026
5 of 6 checks passed
@nange
nange deleted the feat/conns-status branch August 19, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant