pub struct SubtreeUsage {
pub root: ProcessIdentity,
pub members: Vec<ProcessIdentity>,
pub cpu: Summed<Percent>,
pub rss_bytes: Summed<u64>,
pub read: Summed<Rate>,
pub write: Summed<Rate>,
pub cycles_broken: u32,
}Expand description
What a process and its descendants are using, together.
Fields§
§root: ProcessIdentityThe process the subtree is rooted at, still present in this snapshot.
members: Vec<ProcessIdentity>Every member, root first, then descendants in breadth-first order.
Breadth-first because a truncated list should show a build’s direct children before its grandchildren, and because the order is then stable under the arbitrary order the OS enumerates processes in.
cpu: Summed<Percent>Summed CPU. May exceed 100% — it is a sum of core-normalized shares (§8.3).
rss_bytes: Summed<u64>Summed resident memory.
Shared pages are counted once per process that maps them, so this over-counts a
family that shares a lot — a browser especially. That is a property of RSS rather
than of this sum, and SubtreeUsage cannot fix it without a
proportional-set-size figure neither platform gives cheaply. Named in the docs
rather than silently presented as a memory total.
read: Summed<Rate>Summed read throughput.
write: Summed<Rate>Summed write throughput.
cycles_broken: u32Parent links that were cut to break a cycle, for the Inspect screen.
Implementations§
Source§impl SubtreeUsage
impl SubtreeUsage
Sourcepub fn of(snapshot: &SystemSnapshot, root: ProcessIdentity) -> Option<Self>
pub fn of(snapshot: &SystemSnapshot, root: ProcessIdentity) -> Option<Self>
Sums root and its descendants in snapshot.
None when root is not in the snapshot — it exited, or a PID was reused and
the identity no longer matches. The caller reports that as the subtree ending
rather than substituting the reparented children (see the module docs).
Sourcepub fn over(
processes: &[ProcessSnapshot],
root: ProcessIdentity,
) -> Option<Self>
pub fn over( processes: &[ProcessSnapshot], root: ProcessIdentity, ) -> Option<Self>
Sums over an arbitrary process list, which is what the tests and the reducer use.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the subtree holds nothing, which cannot happen: the root is a member.
Sourcepub fn has_partial_sums(&self) -> bool
pub fn has_partial_sums(&self) -> bool
Whether any visible figure understates the subtree.
The flag a renderer needs next to the numbers: true means at least one sum is a
lower bound, and the per-metric Summed::coverage says which and by how many
members.
Trait Implementations§
Source§impl Clone for SubtreeUsage
impl Clone for SubtreeUsage
Source§fn clone(&self) -> SubtreeUsage
fn clone(&self) -> SubtreeUsage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more