Logo ProcessKit API Reference

ProcessGroupStats Type

A snapshot of a process group's resource usage. Optional peak-process, CPU, memory, and I/O fields are `None` when the platform can't report them — the POSIX process-group mechanism (macOS and the Linux fallback) has no kernel accumulator, and neither does the FreeBSD process reaper, which contains a tree but accounts for nothing in it; the Linux cgroup v2 backend (the `limits` feature) supplies the controller metrics available to it. Sealed with an internal constructor so it can gain metrics without breaking the frozen API.

Instance members

Instance member Description

this.ActiveProcessCount

Full Usage: this.ActiveProcessCount

Returns: int

Number of live processes currently in the group. Under the POSIX process-group mechanism this counts live process *groups* (one per contained child) rather than individual processes — plus each individually tracked process adopted by pid (`ProcessGroup.AdoptByPid`), which is one process rather than a group; with a Job Object (or cgroup) it is the exact process count, as it is on the FreeBSD process reaper, which counts every live process in the whole contained tree (a member that has exited is not counted).

Returns: int

this.IoReadBytes

Full Usage: this.IoReadBytes

Returns: int64 option

Bytes read by the contained tree, if the containment mechanism exposes an aggregate I/O counter. Windows reports the Job Object's OS I/O total; Linux cgroup v2 reports block-device bytes from `io.stat`; the POSIX process-group fallback and the FreeBSD process reaper return `None`.

Returns: int64 option

this.IoReadOperations

Full Usage: this.IoReadOperations

Returns: int64 option

Read operations performed by the contained tree, when the platform exposes the count.

Returns: int64 option

this.IoWriteBytes

Full Usage: this.IoWriteBytes

Returns: int64 option

Bytes written by the contained tree, with the same platform availability as `IoReadBytes`.

Returns: int64 option

this.IoWriteOperations

Full Usage: this.IoWriteOperations

Returns: int64 option

Write operations performed by the contained tree, when the platform exposes the count.

Returns: int64 option

this.PeakMemoryBytes

Full Usage: this.PeakMemoryBytes

Returns: int64 option

Peak memory used by the group in bytes, if available — the OS's own group-wide measure (Windows: the Job's peak *committed* memory). Not directly comparable across platforms.

Returns: int64 option

this.PeakProcessCount

Full Usage: this.PeakProcessCount

Returns: int64 option

Maximum number of kernel tasks (processes and their threads) charged to the group at once over its lifetime, if the containment mechanism exposes a native counter. Linux cgroup v2 reports `pids.peak` only when `MaxProcesses` is configured and the kernel is version 6.6 or later. This task count is not directly comparable with `ActiveProcessCount`, which counts process leaders. Windows Job Objects, the FreeBSD process reaper and the POSIX process-group fallback return `None`.

Returns: int64 option

this.TotalCpuTime

Full Usage: this.TotalCpuTime

Returns: TimeSpan option

Total CPU time (user + kernel) accumulated by the group, if available. On Windows this is cumulative across every process that has ever been in the Job (including terminated ones).

Returns: TimeSpan option

Type something to start searching.