Repository navigation
Server.Stats and godoc examples - #27
Merged
Merged
Conversation
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>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #27 +/- ##
==========================================
+ Coverage 60.17% 61.48% +1.31%
==========================================
Files 18 19 +1
Lines 1052 1093 +41
==========================================
+ Hits 633 672 +39
- Misses 419 421 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #26, which GitHub closed when its base branch (release/v0.1.0) was deleted on merge.
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);Statscollects them by posting to each loop.example_test.go(roadmap item 22, part): pkg.go.dev examples —Listenwith graceful shutdown,Conn.AsyncWritefrom other goroutines, per-connection state and close reasons, publishingStatswith expvar.Stats.Tested in the Lima VM (Linux 6.17):
go test -race ./..., staticcheck.🤖 Generated with Claude Code