pub struct ProcessSnapshot {Show 14 fields
pub identity: ProcessIdentity,
pub parent_pid: Option<u32>,
pub name: Box<str>,
pub command: Box<str>,
pub exe: Option<Box<str>>,
pub user: MetricState<UserIdentity>,
pub state: ProcessState,
pub cpu: MetricState<Percent>,
pub memory: ProcessMemory,
pub io: ProcessIo,
pub threads: MetricState<u32>,
pub age: MetricState<Duration>,
pub started_at: MetricState<SystemTime>,
pub is_kernel_thread: bool,
}Expand description
The cheap per-process fields collected on every fast tick.
Fields§
§identity: ProcessIdentityStable identity, safe to pin and to attach to a pending signal.
parent_pid: Option<u32>Parent PID.
A bare PID rather than a ProcessIdentity because the parent’s start
key is not available from the same read; tree construction resolves it
against the rest of the snapshot.
name: Box<str>Short process name, as the kernel reports it.
command: Box<str>Full command line, arguments joined by single spaces.
Stored pre-joined to avoid a Vec<String> per process per tick. May be
empty for kernel threads or another user’s process, and §14.2 requires it
to be redacted from logs because arguments can contain secrets.
exe: Option<Box<str>>Executable path, where readable.
user: MetricState<UserIdentity>Owning user.
state: ProcessStateScheduling state.
cpu: MetricState<Percent>CPU usage, core-normalized. May exceed 100% (§8.3).
memory: ProcessMemoryMemory figures.
io: ProcessIoDisk I/O.
threads: MetricState<u32>Thread count, where reported.
age: MetricState<Duration>Time since the process started.
started_at: MetricState<SystemTime>Wall-clock start time, for the confirmation dialog (§6.2).
is_kernel_thread: boolWhether this is a kernel thread, which §7.2 allows hiding on Linux.
Implementations§
Source§impl ProcessSnapshot
impl ProcessSnapshot
Sourcepub fn command_or_name(&self) -> &str
pub fn command_or_name(&self) -> &str
The command line if non-empty, otherwise the process name.
Kernel threads and processes belonging to other users report no command line; showing an empty cell would look like a collection bug.
Sourcepub fn redacted_command(&self) -> &str
pub fn redacted_command(&self) -> &str
The command line with arguments removed, keeping only argv[0].
§15.2 requires JSON export to be able to redact arguments by default, and §14.2 requires the same for logs.
Trait Implementations§
Source§impl Clone for ProcessSnapshot
impl Clone for ProcessSnapshot
Source§fn clone(&self) -> ProcessSnapshot
fn clone(&self) -> ProcessSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more