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

Get the number of logcal CPUs dynamically #6214

Merged

Conversation

adrianlzt
Copy link
Contributor

@adrianlzt adrianlzt commented Aug 6, 2019

runtime.NumCPU() return the number of logical CPUs at the startup of the
process, https://golang.org/pkg/runtime/#NumCPU.
gopsutil return the current number of CPUs, giving the correct number
when CPU hot un/plug are being done.

closes #5451

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

runtime.NumCPU() return the number of logical CPUs at the startup of the
process, https://golang.org/pkg/runtime/#NumCPU.
gopsutil return the current number of CPUs, giving the correct number
when CPU hot un/plug are being done.
@alvarolmedo
Copy link
Contributor

+1

Copy link
Contributor

@glinton glinton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable change, thanks

@glinton glinton added area/system feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin labels Aug 6, 2019
@danielnelson danielnelson added this to the 1.12.0 milestone Aug 6, 2019
@danielnelson danielnelson merged commit a3a6752 into influxdata:master Aug 6, 2019
bitcharmer pushed a commit to bitcharmer/telegraf that referenced this pull request Oct 18, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/system feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

restart needed for system.ncpus to update
4 participants