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

[Bug] cpu usage is not accurate #107

Open
icankeep opened this issue Aug 7, 2021 · 1 comment
Open

[Bug] cpu usage is not accurate #107

icankeep opened this issue Aug 7, 2021 · 1 comment
Labels

Comments

@icankeep
Copy link

icankeep commented Aug 7, 2021

now

  if config.track_cpu_percent:
      cpu_count = psutil.cpu_count()
      cpu_percent = await self._get_cpu_percent(all_processes)

      if config.cpu_limit != 0:
          limits["cpu"] = {"cpu": config.cpu_limit}
          if config.cpu_warning_threshold != 0:
              limits["cpu"]["warn"] = (config.cpu_limit - cpu_percent) < (
                  config.cpu_limit * config.cpu_warning_threshold
              )

      metrics.update(cpu_percent=cpu_percent, cpu_count=cpu_count)

Why not use psutil's cpu usage directly?

e.g.

psutil.cpu_percent()
@icankeep icankeep added the bug label Aug 7, 2021
@welcome
Copy link

welcome bot commented Aug 7, 2021

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant