Skip to main content

Assembler

Struct Assembler 

Source
pub struct Assembler {
Show 13 fields pub quiet: bool, pub(crate) manifest: Manifest, pub(crate) canonical: Canonical, pub(crate) evidence: BTreeMap<(UnitId, ProbeId), Evidence>, pub(crate) last_run: BTreeMap<(UnitId, ProbeId), Timestamp>, pub(crate) on_demand: BTreeSet<(UnitId, ProbeId)>, pub failed_since: BTreeMap<UnitId, Timestamp>, pub known_drivers: BTreeMap<UnitId, DriverRef>, pub sessions: Vec<SessionInfo>, pub(crate) session_seen: BTreeMap<String, Timestamp>, pub on_battery: bool, pub slow_ticks: u64, pub slow_tick: Option<(Millis, Vec<String>)>,
}

Fields§

§quiet: bool

Quiet mode (§12f): Readiness probes of units foreground work does not depend on drop to their slowest interval.

§manifest: Manifest§canonical: Canonical§evidence: BTreeMap<(UnitId, ProbeId), Evidence>§last_run: BTreeMap<(UnitId, ProbeId), Timestamp>§on_demand: BTreeSet<(UnitId, ProbeId)>§failed_since: BTreeMap<UnitId, Timestamp>§known_drivers: BTreeMap<UnitId, DriverRef>§sessions: Vec<SessionInfo>§session_seen: BTreeMap<String, Timestamp>

When each session id was first observed (stands in for an unknown creation time).

§on_battery: bool§slow_ticks: u64

Ticks that went over budget (logged by the daemon).

§slow_tick: Option<(Millis, Vec<String>)>

The last tick over budget, if the daemon has not reported it yet: how long it took and the probes that ran in it (P9).

Implementations§

Source§

impl Assembler

Source

pub fn new(manifest: Manifest, canonical: Canonical) -> Assembler

Source

pub fn set_manifest(&mut self, manifest: Manifest)

A new generation’s manifest (after a commit, revert or boot).

Source

pub fn manifest(&self) -> &Manifest

Source

pub fn defs(&self) -> UnitDefs

System units plus one instance of each user template per user with an established session (§10: a user service is desired only while that user’s session exists).

Source

pub fn request(&mut self, unit: &UnitId, probe: &ProbeId)

Run a Diagnostic (or any) probe on the next tick: user-initiated diagnostics (§10).

Source

pub fn reprobe(&mut self, unit: &UnitId)

Re-run every Readiness probe of unit now (diagnostic incident: re-observe).

Source

pub(crate) fn interval(&self, p: &ProbeDef) -> Option<Millis>

Source

pub(crate) fn stale_after(&self, p: &ProbeDef) -> Millis

Source

pub(crate) fn quieted( &self, def: &UnitDef, p: &ProbeDef, now: Timestamp, ) -> bool

Quiet mode holds back a probe of a unit foreground work does not plausibly depend on (audio, the compositor, input devices, the network), to once a minute.

Source

pub(crate) fn due(&self, unit: &UnitId, p: &ProbeDef, now: Timestamp) -> bool

Source

pub(crate) fn observe_unit<B: Backends>( &mut self, b: &B, def: &UnitDef, devices: &BTreeMap<UnitId, Option<DriverRef>>, ) -> Observed

Source

pub(crate) fn session_of(&self, id: &UnitId) -> Option<&SessionInfo>

The logind session a session-bound unit instance belongs to.

Source

pub(crate) fn session_up<B: Backends>( &self, b: &B, target: &str, s: &SessionInfo, ) -> bool

Whether this session’s desktop is up (§9): the compositor in the session’s own cgroup is running, when the backend can see that; else the target in the user’s manager, which is only corroboration (for a second session of the same uid it was reached already).

Source

pub(crate) fn observe_session_target<B: Backends>( &self, b: &B, target: &str, within: Millis, now: Timestamp, s: &SessionInfo, ) -> Observed

§9 graphical-session, for one session: up within within of the session’s creation. Before the deadline it is Transitioning; a missed deadline makes it inactive, and its probe fails.

Source

pub(crate) fn session_target_result<B: Backends>( &self, b: &B, id: &UnitId, target: &str, within: Millis, now: Timestamp, ) -> ProbeResult

Source

pub fn observe<B: Backends>(&mut self, b: &B, ctx: &Context) -> SystemState

One tick: observe, probe, assemble.

Trait Implementations§

Source§

impl Clone for Assembler

Source§

fn clone(&self) -> Assembler

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Assembler

Source§

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

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

impl Default for Assembler

Source§

fn default() -> Assembler

Returns the “default value” for a type. Read more

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

Source§

type Output = T

Should always be Self
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.