-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetching Statistics from memcached server #39
base: master
Are you sure you want to change the base?
Conversation
19603e4
to
d2245ca
Compare
Any news about this PR? When the merge will be made? |
memcache/memcache.go
Outdated
|
||
func parseStatsLine(s []byte, expectedPrefix []byte) (uint64, error) { | ||
if !bytes.HasPrefix(s, expectedPrefix) { | ||
return 0, errors.New("line does not start with exceptedPrefix") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors.New allocates each time. I'd make that a global err variable instead.
memcache/memcache.go
Outdated
@@ -171,6 +177,24 @@ type conn struct { | |||
c *Client | |||
} | |||
|
|||
// Statistics is a record of memcached usage stats. | |||
type Statistics struct { | |||
// Counter of cache hits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write complete sentences.
See https://github.com/golang/go/wiki/CodeReviewComments#comment-sentences
// Hits is ...
(ending in a period)
memcache/memcache.go
Outdated
} | ||
|
||
|
||
func (c *Client) Stats(addr net.Addr) (*Statistics, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lacks comments.
Also, why does it take an Addr? It seems like most people would want aggregated statistics across all nodes for a method named "Stats".
Maybe this should be called "NodeStats".
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
@bradfitz , thanks for your comments, it was very useful. Could you please take a look at my changes again. |
Hi! My commit has a committer email '[email protected]', and I was told that Yandex LLC has a CLA agreement (mostly contributing to the Chromium repository). Could you please check, why I did not pass the CLA check. Thanks! |
Hi!
I am very new to Go programming language, but I'd like to implement Statistics (https://cloud.google.com/appengine/docs/go/memcache/reference?csw=1#Statistics) in gomemcache library.
Could you please, take a look on my patch? I will be pleased to fix any problems in it you find.
Thank you in advance.
This is how I use it