spdl.pipeline.ProcessStats

class ProcessStats(pid: int, ppid: int, name: str, new: bool, minflt: int | None, majflt: int | None, utime: float | None, stime: float | None, cminflt: int | None, cmajflt: int | None, cutime: float | None, cstime: float | None, voluntary_ctxt_switches: int | None, nonvoluntary_ctxt_switches: int | None, rchar: int | None, wchar: int | None, read_bytes: int | None, write_bytes: int | None, num_threads: int | None, rss: int | None, rss_anon: int | None, rss_file: int | None, rss_shmem: int | None, peak_rss: int | None, swap: int | None, pss: int | None = None, pss_anon: int | None = None, anonymous: int | None = None, private: int | None = None)[source]

Counters of one process over the sampling interval.

Counters (faults, CPU time, context switches, I/O) are increases over the interval; memory values are as of the end of the interval. None means the value is unavailable on this kernel or to this user, never zero.

Added in version 0.9.0.

Attributes

anonymous

Anonymous memory from smaps_rollup, in bytes.

private

what would be freed if it exited.

pss

Proportional set size, in bytes.

pss_anon

Anonymous part of pss, in bytes.

pid

Process ID.

ppid

Parent process ID.

name

The process's comm (executable name, at most 15 bytes).

new

The process was not seen in the previous sample, so its counters cover its whole life rather than the interval.

minflt

a page was mapped without disk I/O, such as first touch of freshly allocated memory.

majflt

the page had to be read from disk or swap.

utime

CPU time in user mode, in seconds.

stime

CPU time in kernel mode, in seconds.

cminflt

Minor faults of child processes that exited and were reaped in the interval.

cmajflt

Major faults of child processes that exited and were reaped in the interval.

cutime

User CPU time, in seconds, of child processes reaped in the interval.

cstime

Kernel CPU time, in seconds, of child processes reaped in the interval.

voluntary_ctxt_switches

Context switches because the process waited (I/O, lock, sleep).

nonvoluntary_ctxt_switches

Context switches because the scheduler preempted the process.

rchar

Bytes read through syscalls, including from the page cache.

wchar

Bytes written through syscalls.

read_bytes

Bytes the process caused to be read from storage.

write_bytes

Bytes the process caused to be written to storage.

num_threads

Number of threads at the end of the interval.

rss

Resident memory, in bytes.

rss_anon

Resident anonymous memory (heap, stacks, private mappings), in bytes.

rss_file

Resident file-backed memory, in bytes.

rss_shmem

Resident shared memory (shm, tmpfs, shared anonymous), in bytes.

peak_rss

Peak resident memory over the process's life (VmHWM), in bytes.

swap

Swapped-out memory, in bytes.

anonymous: int | None = None

Anonymous memory from smaps_rollup, in bytes. Only with smaps_rollup=True.

cmajflt: int | None

Major faults of child processes that exited and were reaped in the interval.

cminflt: int | None

Minor faults of child processes that exited and were reaped in the interval.

cstime: float | None

Kernel CPU time, in seconds, of child processes reaped in the interval.

cutime: float | None

User CPU time, in seconds, of child processes reaped in the interval.

majflt: int | None

the page had to be read from disk or swap.

Type:

Major page faults

minflt: int | None

a page was mapped without disk I/O, such as first touch of freshly allocated memory.

Type:

Minor page faults

name: str

The process’s comm (executable name, at most 15 bytes).

new: bool

The process was not seen in the previous sample, so its counters cover its whole life rather than the interval.

nonvoluntary_ctxt_switches: int | None

Context switches because the scheduler preempted the process.

num_threads: int | None

Number of threads at the end of the interval.

peak_rss: int | None

Peak resident memory over the process’s life (VmHWM), in bytes.

pid: int

Process ID.

ppid: int

Parent process ID.

private: int | None = None

what would be freed if it exited. Only with smaps_rollup=True.

Type:

Memory exclusive to the process (Private_Clean + Private_Dirty), in bytes

pss: int | None = None

Proportional set size, in bytes. Only with smaps_rollup=True.

pss_anon: int | None = None

Anonymous part of pss, in bytes. Only with smaps_rollup=True.

rchar: int | None

Bytes read through syscalls, including from the page cache.

read_bytes: int | None

Bytes the process caused to be read from storage.

rss: int | None

Resident memory, in bytes.

rss_anon: int | None

Resident anonymous memory (heap, stacks, private mappings), in bytes.

rss_file: int | None

Resident file-backed memory, in bytes.

rss_shmem: int | None

Resident shared memory (shm, tmpfs, shared anonymous), in bytes.

stime: float | None

CPU time in kernel mode, in seconds. Includes page-fault handling and syscalls.

swap: int | None

Swapped-out memory, in bytes.

utime: float | None

CPU time in user mode, in seconds.

voluntary_ctxt_switches: int | None

Context switches because the process waited (I/O, lock, sleep).

wchar: int | None

Bytes written through syscalls.

write_bytes: int | None

Bytes the process caused to be written to storage.