How does HTOP gather information like CPU consumption, memory consumption etc by every process and the whole system? I am not familiar with any operating system specific api (like socket api) that is provided by linux in order to gather those statistics.
Asked
Active
Viewed 157 times
1 Answers
0
Well, I'd point you to the htop
sources, first.
Then, operating systems like Linux have a lot of interfaces to get those information. Some of these metrics are available via the classical /proc
pseudo-filesystem, or via /sys/
; others might be only available via ioctl
s or specific system calls (e.g. getgid
).

Marcus Müller
- 34,677
- 4
- 53
- 94