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

Feature/use client #7

Merged
merged 2 commits into from
Oct 5, 2016
Merged

Feature/use client #7

merged 2 commits into from
Oct 5, 2016

Conversation

kenjones-cisco
Copy link
Contributor

Add support for using mongodb client instead of mongostat cli.
For purposes of backwards-compatibility the default is still mongostat
but using configuration useClient then the mongodb client is used
to retrieve the stats. This means you can gather stats from a db
instance that is remote from you without installing any Mongodb
binaries.

Also adds support for environment variables for each of the
configuration options.

Add support for using mongodb client instead of mongostat cli.
For purposes of backwards-compatibility the default is still mongostat
but using configuration `useClient` then the mongodb client is used
to retrieve the stats. This means you can gather stats from a db
instance that is remote from you without installing any Mongodb
binaries.

Also adds support for environment variables for each of the
configuration options.
The correct api is serverStatus under Admin, so switch to correct API.
Leverage callback to make sure the provider is initialized before
attempting to refresh the metrics.
@kenjones-cisco
Copy link
Contributor Author

My use case requires accessing a mongodb in another docker container where the local container does not have mongostat or any other related mongodb binary installed. This simply makes it possible to use either/or approach in a consistent manner.

@slhad
Copy link

slhad commented May 8, 2016

+1

@alavit-d alavit-d merged commit 38dad0c into pm2-hive:master Oct 5, 2016
@alavit-d
Copy link
Contributor

alavit-d commented Oct 5, 2016

Thanks for the contribution! Merged to master with few changes:

  • Removed totally the mongostat use and shelljs dependency for better consistency/maintenance
  • Retrieved values via client are total numbers instead of numbers/s, modified it to keep it in numbers/s.

Cheers

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.

None yet

3 participants