Skip to main content

App

Struct App 

Source
pub struct App {
Show 36 fields pub view: View, pub theme: Theme, pub support: ColorSupport, pub lang: Lang, pub help: Option<HelpState>, pub hits: Vec<Hit>, pub sort: SortKey, pub cgroup_sort: CgroupSort, pub cgroup_sel: usize, pub app_groups: Vec<AppGroup>, pub app_history: HashMap<String, VecDeque<AppSample>>, pub app_sel: usize, pub app_metric: AppMetric, pub app_state: TableState, pub pid_filter: Option<HashSet<u32>>, pub pid_filter_name: Option<String>, pub drill: Option<String>, pub drill_sel: usize, pub desc: bool, pub filter: String, pub detail_filter: String, pub expanded: HashSet<String>, pub editing: bool, pub editing_detail: bool, pub edit_buf: String, pub sel: usize, pub detail: bool, pub detail_sel: usize, pub snap: Option<Snapshot>, pub table_state: TableState, pub cgroup_state: TableState, pub drill_state: TableState, pub detail_state: TableState, pub history: HashMap<u32, VecDeque<u64>>, pub cgroup_history: HashMap<String, VecDeque<u64>>, pub oom_history: HashMap<String, VecDeque<u64>>, /* private fields */
}

Fields§

§view: View§theme: Theme

Active built-in theme; t cycles it.

§support: ColorSupport

Terminal colour depth the active palette was rendered for.

§lang: Lang

UI language; l toggles it.

§help: Option<HelpState>

Open help overlay, if any.

§hits: Vec<Hit>

Click targets recorded by the last draw.

§sort: SortKey§cgroup_sort: CgroupSort§cgroup_sel: usize§app_groups: Vec<AppGroup>

App groups for the treemap, recomputed per snapshot (collapsed to the top few percent so the map does not dissolve into slivers).

§app_history: HashMap<String, VecDeque<AppSample>>

Metric history per app name (only the collapsed groups are tracked: ~20-40 entries, not all 330).

§app_sel: usize§app_metric: AppMetric§app_state: TableState§pid_filter: Option<HashSet<u32>>

Drill target coming from the apps view: only these pids are shown in the process table.

§pid_filter_name: Option<String>§drill: Option<String>

cgroup path whose processes are being listed (drill-down).

§drill_sel: usize§desc: bool§filter: String§detail_filter: String

Mapping-name filter for the VMA detail view (independent of filter).

§expanded: HashSet<String>

Group labels whose VMAs are expanded.

§editing: bool§editing_detail: bool

Whether the in-progress edit targets the detail filter.

§edit_buf: String§sel: usize§detail: bool§detail_sel: usize§snap: Option<Snapshot>§table_state: TableState§cgroup_state: TableState§drill_state: TableState§detail_state: TableState§history: HashMap<u32, VecDeque<u64>>§cgroup_history: HashMap<String, VecDeque<u64>>

PSI some avg10 over time per cgroup, stored as percent*10 for the sparkline (u64) with a fixed 0-1000 scale.

§oom_history: HashMap<String, VecDeque<u64>>

OOM kills per scan per cgroup (5 s cadence, 120 samples = 10 min).

Implementations§

Source§

impl App

Source

pub fn new(start_pid: Option<u32>) -> Self

Source

pub fn visible(&self) -> Vec<&ProcRow>

Source

pub fn visible_cgroups(&self) -> Vec<&CgroupMem>

Source

pub fn cgroup_members(&self) -> Vec<&ProcRow>

Processes whose cgroup is drill or a descendant of it. The cgroup numbers are hierarchical, so the subtree is what you want to see.

Source

pub fn app_series(&self, name: &str, metric: AppMetric) -> Vec<u64>

Series for the selected metric of name, for the header sparkline.

Source

pub fn visible_apps(&self) -> Vec<&AppGroup>

Source

pub fn selected_app(&self) -> Option<&AppGroup>

Source

pub fn selected_pid(&self) -> Option<u32>

Source

pub fn focus_target(&self) -> (Option<u32>, bool)

The (pid, want_detail) pair the sampler should be working on.

Source

pub fn take_focus_update(&mut self) -> Option<Focus>

Source

pub fn on_snapshot(&mut self, snap: Snapshot)

Source

pub fn detail_rows(&self) -> Vec<DetailRow<'_>>

Flattened detail rows: every matching group, followed by its VMAs when expanded. Selection indexes into this vector.

Source

pub fn detail_len(&self) -> usize

Source

pub fn on_mouse(&mut self, mouse: MouseEvent) -> bool

Source

pub fn handle_event(&mut self, event: Event) -> bool

Source

pub fn on_key(&mut self, key: KeyEvent) -> bool

Returns true when the app should exit.

Source

pub fn run( terminal: &mut DefaultTerminal, start_pid: Option<u32>, theme: Theme, support: ColorSupport, lang: Lang, tx: Sender<Focus>, rx: Receiver<Snapshot>, ) -> Result<()>

Source

pub fn sample_age_ms(&self) -> u128

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl UnwindSafe for App

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.