-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Couchbase input plugin #866
Conversation
Make `go vet` happy.
if err != nil { | ||
return err | ||
} | ||
pool, err := client.GetPool("default") |
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.
make the pool name configurable?
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.
Here you can make the client and pool getting a "pluggable" function. That way you can write unit tests that plugin a function that returns a mocked pool.
Shouldn't be too hard to create the mocked return data because the go data structures are based off JSON, so you should be able to use json.Marshal with some sample json.
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.
@sparrc, default
is the only possible pool name. It's a placeholder for a possible future Couchbase feature (see explanation).
Overall looks good, but looking through the go-couchbase code it really doesn't look very hard to mock, so I think you should write unit tests for this |
- units: bytes | ||
- tags: `cluster`, `hostname` | ||
|
||
Measurement names: |
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.
these are actually "field names"
Proper terminology and case. Exmaples for tags. Example output.
great, thanks @ljosa!! |
Input plugin for Couchbase. There are many more metrics that could be collected, but this is enough to be useful and all I need for now. Resolves #482.