pub struct ProcNode {
pub pid: u32,
pub ppid: Option<u32>,
pub name: String,
pub cmdline: String,
pub kind: ProcKind,
pub harness: Option<Harness>,
pub cpu_percent: f32,
pub rss_bytes: u64,
pub age_secs: u64,
pub cwd: Option<PathBuf>,
pub children: Vec<ProcNode>,
}Expand description
One process, with its descendants.
Fields§
§pid: u32§ppid: Option<u32>§name: String§cmdline: String§kind: ProcKind§harness: Option<Harness>§cpu_percent: f32§rss_bytes: u64§age_secs: u64§cwd: Option<PathBuf>§children: Vec<ProcNode>Implementations§
Source§impl ProcNode
impl ProcNode
Sourcepub fn totals(&self) -> (f32, u64, usize, usize)
pub fn totals(&self) -> (f32, u64, usize, usize)
CPU, RSS, process count and MCP server count summed over the whole
subtree. An MCP process’s own children (an npx wrapper’s node) are
the same server, so they add to the process count and not to the
server count.
Sourcepub fn mcp_roots(&self) -> Vec<&ProcNode>
pub fn mcp_roots(&self) -> Vec<&ProcNode>
The MCP servers in this tree: each Mcp node whose parent is not one.
A server started through npx or uvx is two or three processes; the
top one stands for the server.
pub fn walk<'a>(&'a self, depth: usize, f: &mut dyn FnMut(&'a ProcNode, usize))
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ProcNode
impl<'de> Deserialize<'de> for ProcNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProcNode
impl RefUnwindSafe for ProcNode
impl Send for ProcNode
impl Sync for ProcNode
impl Unpin for ProcNode
impl UnsafeUnpin for ProcNode
impl UnwindSafe for ProcNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more