Skip to main content

SubtreeUsage

Struct SubtreeUsage 

Source
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: ProcessIdentity

The 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: u32

Parent links that were cut to break a cycle, for the Inspect screen.

Implementations§

Source§

impl SubtreeUsage

Source

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).

Source

pub fn over( processes: &[ProcessSnapshot], root: ProcessIdentity, ) -> Option<Self>

Sums over an arbitrary process list, which is what the tests and the reducer use.

Source

pub fn len(&self) -> usize

How many processes the subtree holds, including the root.

Source

pub fn is_empty(&self) -> bool

Whether the subtree holds nothing, which cannot happen: the root is a member.

Source

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

Source§

fn clone(&self) -> SubtreeUsage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SubtreeUsage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SubtreeUsage

Source§

fn eq(&self, other: &SubtreeUsage) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SubtreeUsage

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.