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

Fixed cpu usage at 101% #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

SondreUM
Copy link

Changes in get_cpu_message()

  • changed grep target to 'CPU'
  • added filter for grep
  • removed float conversion of usage value

Hass.io uses different row name for cpu usage, additionally uses percentage instead of fraction.
From Home Assistant:

$ top
Mem: 1786076K used, 2096116K free, 1440K shrd, 103224K buff, 953800K cached
CPU:   0% usr   0% sys   0% nic  98% idle   0% io   0% irq   0% sirq
Load average: 0.84 1.23 1.17 2/570 299
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
  193   157 root     S     6632   0%   2   0% sshd: root@pts/0

Ubuntu example:

$ top
top - 00:32:20 up 3 days, 55 min,  6 users,  load average: 0.53, 0.38, 0.36
Tasks: 393 total,   1 running, 391 sleeping,   0 stopped,   1 zombie
%Cpu(s):  0.5 us,  1.5 sy,  1.0 ni, 97.1 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  39023.1 total,  26581.8 free,   7949.3 used,   4492.1 buff/cache
MiB Swap:  16384.0 total,  16384.0 free,      0.0 used.  28497.3 avail Mem

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
   1057 root      32  12 1876104  46452  32000 S   6.2   0.1   1:23.63 containerd

Testet on Raspberry pi 4B with Home Assistant:

  • Core 2023.4.3
  • Supervisor 2024.04.0
  • Operating System 12.2

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.

1 participant