Skip to content
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

Closed
wants to merge 7 commits into from
Closed

Conversation

ljosa
Copy link
Contributor

@ljosa ljosa commented Mar 16, 2016

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.

if err != nil {
return err
}
pool, err := client.GetPool("default")
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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).

@sparrc
Copy link
Contributor

sparrc commented Mar 17, 2016

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:
Copy link
Contributor

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.
@sparrc
Copy link
Contributor

sparrc commented Mar 21, 2016

great, thanks @ljosa!!

@sparrc sparrc closed this in 9de4a8e Mar 21, 2016
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.

2 participants