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.

Structs§

ProcStat
What is read from a process’s stat line.

Functions§

read
The thread count and nice value of pid, from one read of its stat.
thread_count
Number of threads of pid, or None if it is gone or unreadable.