package kaun-board
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=96d35ce03dfbebd2313657273e24c2e2d20f9e6c7825b8518b69bd1d6ed5870f
sha512=90c5053731d4108f37c19430e45456063e872b04b8a1bbad064c356e1b18e69222de8bfcf4ec14757e71f18164ec6e4630ba770dbcb1291665de5418827d1465
doc/kaun-board.sysstat/Sysstat/Proc/Table/index.html
Module Proc.TableSource
Process table statistics.
type t = {pid : int;(*Process ID.
*)ppid : int;(*Parent process ID.
*)name : string;(*Process name (comm).
*)cmdline : string;(*Full command line with arguments. Empty if unavailable.
*)state : state;(*Current process state.
*)user : string;(*Owner username. Empty if UID lookup fails.
*)priority : int;(*Scheduling priority.
*)nice : int;(*Nice value (-20 to 19).
*)user_time : int64;(*Cumulative user-mode CPU time in ticks.
*)system_time : int64;(*Cumulative system-mode CPU time in ticks.
*)resident_size : int64;(*Resident set size in bytes.
*)virtual_size : int64;(*Virtual memory size in bytes.
*)num_threads : int;(*Number of threads.
*)num_running : int;(*Number of running threads (macOS only,
*)0on Linux).faults : int64;(*Page faults (macOS only,
*)0Lon Linux).mem_percent : float;(*Memory usage as percentage of total physical memory.
*)
}Raw process snapshot for delta calculation.
Contains cumulative CPU time, state, and instantaneous memory/thread information for a process. CPU times are in platform-specific ticks (Linux jiffies or macOS Mach ticks).
type stats = {pid : int;(*Process ID.
*)name : string;(*Process name.
*)cpu_percent : float;(*CPU usage percentage between samples.
*)mem_percent : float;(*Memory usage as percentage of total physical memory.
*)rss_bytes : int64;(*Resident set size in bytes.
*)
}Computed process statistics.
Contains derived CPU percentage and filtered memory information. Only processes with non-zero CPU or memory usage are included.
sample () returns raw process snapshots for all running processes.
Enumerates all processes visible to the current user and reads their statistics.
Returns an empty list if an error occurs during enumeration. Individual process errors (e.g., process termination during sampling) are silently skipped.
compute ~prev ~next ~dt calculates CPU percentages and filters processes.
Matches processes by PID between prev and next samples. For matched processes, computes CPU percentage as: (cpu_time_delta_ns / interval_ns) * 100.
Only processes with non-zero cpu_percent or mem_percent are included in the result. New processes (in next but not prev) are included if their mem_percent is non-zero, with cpu_percent set to 0.0.