ProcessSnapshot
classin packageklyn.process
public class ProcessSnapshot
ProcessSnapshot

Immutable process observation. All getters are O(1); check status first. CPU is 0..100 percent of the whole machine's logical CPU capacity. residentMemoryBytes is RSS/working set; privateMemoryBytes is anonymous RSS on Linux, private committed bytes on Windows, owned resident pages on KlynOS. These private-memory definitions are intentionally not interchangeable.

Example

if row.status(ProcessField.NAME) == MetricStatus.AVAILABLE: print(row.name)

Properties
Modifier and Type Member Description
public readonly property cpuKernelTimeNs
cpuKernelTimeNs as ULong
cpuKernelTimeNs observation, in bytes/ns where applicable.
public readonly property cpuPercent
cpuPercent as Double
Whole-machine normalized CPU; the first observation is NOT_READY.
public readonly property cpuUserTimeNs
cpuUserTimeNs as ULong
cpuUserTimeNs observation, in bytes/ns where applicable.
public readonly property executablePath
executablePath as String
executablePath observation, in bytes/ns where applicable.
public readonly property identity
identity as ProcessIdentity
Stable identity; unavailable identities cannot be used for control.
public readonly property name
name as String
name observation, in bytes/ns where applicable.
public readonly property parentPid
parentPid as ULong
parentPid observation, in bytes/ns where applicable.
public readonly property pid
pid as ULong
Enumerated PID, including when optional identity fields are inaccessible.
public readonly property privateMemoryBytes
privateMemoryBytes as ULong
privateMemoryBytes observation, in bytes/ns where applicable.
public readonly property residentMemoryBytes
residentMemoryBytes as ULong
residentMemoryBytes observation, in bytes/ns where applicable.
public readonly property state
state as ProcessState
Portable lifecycle state.
public readonly property threadCount
threadCount as UInt
threadCount observation, in bytes/ns where applicable.
public readonly property userId
userId as String
userId observation, in bytes/ns where applicable.
public readonly property userName
userName as String
userName observation, in bytes/ns where applicable.
Constructors
Modifier and Type Member Description
public ProcessSnapshot
ProcessSnapshot(data as ProcessSample, cpu as Double, cpuStatus as MetricStatus)
Runtime adapter constructor.
Methods
Modifier and Type Member Description
public status
status(notnull field as ProcessField) as MetricStatus
Returns availability without reading a scalar or throwing for missing data.