Conversation
stats for client
|
Hello @bradfitz, could you please review this PR. Thank you! |
bradfitz
left a comment
There was a problem hiding this comment.
Please also squash this into a single commit.
| return &Client{selector: ss} | ||
| } | ||
|
|
||
| // Stats contains statistic about connections being used by client. |
| // Stats contains statistic about connections being used by client. | ||
| type Stats struct { | ||
| ActiveConns int | ||
| IdleConns int |
| // be set to a number higher than your peak parallel requests. | ||
| MaxIdleConns int | ||
|
|
||
| // number of currently used connections |
There was a problem hiding this comment.
add docs that this must be accessed atomically
| return m, err | ||
| } | ||
|
|
||
| // Stats returns current statistic |
There was a problem hiding this comment.
the current statistics. (with trailing period)
| selector ServerSelector | ||
|
|
||
| lk sync.Mutex | ||
| lk sync.RWMutex |
There was a problem hiding this comment.
maybe more straightforward to just make idleConns an atomic int as well and inc/dec when freeconn changes?
code.google.com is in archive/maintenance mode, and redirects the original URL to: https://cloud.google.com/appengine/docs/standard/go/memcache/reference Let's just use a godoc URL instead.
Replace code.google.com URL with godoc.org URL
* Use ReadFull instead of ioutil.ReadAll to read objects ioutil.ReadAll uses a bytes.Buffer, which allocates memory by doubling. Since we know exactly how muh data we expect to get, we can allocate it in advance. This reduces the total amount of allocation, and ensures that the slice stored in the item won't have excess capacity (which can affect memory usage if the item is held for a long time, for instance in a secondary cache).
This is mentioned in the Expiration field of the Item struct (no expiration time), but not in the notes about the Touch function.
- [go modules](https://github.com/golang/go/wiki/Modules) will be enabled in 1.13. - after merge it would be nice if you would tag this repo: e.g. `v1.0.0` - this will allow consumers something more consistent and readable than `v0.0.0-20181229203832-0af3f3b09a0a`.
* Add Ping method.
|
Can I vote on this? Or offer to address the feedback in this PR? We also need this info for stats / monitoring. |
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
@mkabischev are you opening a new one rebased instead of merged? |
|
Opened a version as #124 |
Return ss.SetServers()'s error to make debugging easier. Updates bradfitz#83 Closes bradfitz#63 Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
Hi, this PR adds possibility to get information about number of active & idle connections.