Skip to main content

Module procstat

Module procstat 

Source
Expand description

Thread counts from /proc/<pid>/stat.

sysinfo only knows a process’s threads when it refreshes every thread as well (/proc/<pid>/task/*), which costs several reads per thread on every sample: on a desktop with thousands of browser and Electron threads, that is most of the collection time. The count itself is one field of the process’s own stat file.

Functions§

thread_count
Number of threads of pid, or None if it is gone or unreadable.