Skip to content

Server.Stats and godoc examples - #26

Closed
y001j wants to merge 1 commit into
release/v0.1.0from
feat/stats
Closed

y001j wants to merge 1 commit into
release/v0.1.0from
feat/stats

Conversation

@y001j

@y001j y001j commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Stacked on #25 (base will switch to master once #25 is merged).

  • Server.Stats() (roadmap item 17): open connections, accepted, accept errors, bytes read/written, idle/write timeouts, receive-buffer exhaustion (-ENOBUFS), backpressure pauses, zero-copy sends. Counters are plain fields updated on the loop thread (no cost on the data path); Stats collects them by posting to each loop.
  • example_test.go (roadmap item 22, part): pkg.go.dev examples — Listen with graceful shutdown, Conn.AsyncWrite from other goroutines, per-connection state and close reasons, publishing Stats with expvar.
  • README (EN/中文) Server table lists Stats.

Tested in the Lima VM (Linux 6.17): go test -race ./..., staticcheck.

🤖 Generated with Claude Code

Stats returns counters summed over the rings: open connections,
accepted, accept errors, bytes read/written, idle and write timeouts,
receive-buffer exhaustion (-ENOBUFS), backpressure pauses and zero-copy
sends. The counters are plain fields updated on the loop thread, so the
data path pays nothing; Stats reads them by posting to each loop.

example_test.go adds pkg.go.dev examples for Listen with graceful
shutdown, Conn.AsyncWrite from other goroutines, per-connection state
and close reasons, and publishing Stats with expvar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@y001j
y001j deleted the branch release/v0.1.0 November 22, 2026 11:55
@y001j y001j closed this Nov 22, 2026
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