Skip to main content

Screen

Struct Screen 

Source
pub struct Screen {
Show 21 fields pub facts: Facts, pub hostname: Option<String>, pub addresses: Vec<IfAddr>, pub dns: Option<Vec<Ipv4Addr>>, pub cpu_model: Option<String>, pub cpus: usize, pub cpu_percent: Option<u8>, pub load1: Option<String>, pub memory: Option<(u64, u64)>, pub disk: Option<(u64, u64)>, pub explode: Option<(u64, u64)>, pub disk_kind: Option<DiskKind>, pub writer: Option<&'static str>, pub uptime_secs: Option<u64>, pub now_unix: u64, pub rows: VecDeque<Row>, pub dropped: u64, pub index: Vec<Row>, pub standby: Vec<Row>, pub tenants: Vec<Row>, pub flow: Vec<Row>, /* private fields */
}
Expand description

Everything the frame is drawn from.

Fields§

§facts: Facts§hostname: Option<String>§addresses: Vec<IfAddr>§dns: Option<Vec<Ipv4Addr>>

What /etc/resolv.conf names, read each tick: None = no file. On the host line as dns a, b / dns none, because a box that can spell an address and not a name looks healthy from every other row (measured 2026-09-08: two re-images to learn github.com did not resolve).

§cpu_model: Option<String>§cpus: usize§cpu_percent: Option<u8>§load1: Option<String>§memory: Option<(u64, u64)>

(total, available) bytes.

§disk: Option<(u64, u64)>§explode: Option<(u64, u64)>

The exploded read cache, summed over every open repository: (used, budget). Named on the band because it is the one number on the box that grows with READS rather than with pushes, and because an operator looking at a full /data needs to know which part of it the server will give back on its own. None until the first tick with an engine.

§disk_kind: Option<DiskKind>

What the data root IS (4×75G raid0 xfs); None = say nothing.

§writer: Option<&'static str>

The writer arm the stores append through (uring / safe), after the first store opened; None = say nothing.

§uptime_secs: Option<u64>§now_unix: u64§rows: VecDeque<Row>§dropped: u64

Lines the tap could not buffer (logtap::dropped), shown when > 0.

§index: Vec<Row>

The index rows: one per repository with a pack being resolved, re-sampled every tick and drawn between the band and the event list — index alice/linux 34% 4.7M/13.9M resolve 2.1 GB/s. Information, never a gate: the tick reads a few atomics and nothing else.

§standby: Vec<Row>

The standby rows, one per configured replication target, drawn with the index rows between the band and the event list:

 standby  standby  synced 105  failed 40  last 00:00:03 ago
!standby  standby  synced 0  failed 8  last successful replication: NEVER

The ! is the staleness alarm. Nothing on this box said anything at all while every configured standby received NOTHING for weeks; this row is the answer to that, and the never wording is deliberately its own sentence — see crate::replication_view::StandbyRow::describe.

§tenants: Vec<Row>

The tenants row (metered only): tenants paid N grace N suspended N, re-sampled every tick like the standby rows and drawn with them. Empty when nothing fills Facts::tenants.

§flow: Vec<Row>

The flow row: flow in 4.2 GiB out 1.1 GiB today · silent 3 of 12. The other half of the tenants band, and the half that exists on every build — what the tenants are DOING, beside what they are paying.

Its own Vec rather than a second entry in Screen::tenants so that the two can be sampled from two different sources and either can be absent alone: a community box draws this row and no tenants row, and a metered box before the first flush draws the tenants row and not this one.

Implementations§

Source§

impl Screen

Source

pub fn new(facts: Facts) -> Self

Source

pub fn sample_tenants(&mut self, counts: Option<TenantCounts>)

Re-derive the tenants row. Public so the render test can feed it counts without an entitlement slot. None draws nothing — the community band must not show a row of zeros on a box that cannot know. Any suspended tenant makes it a WARN row: that is revenue not arriving.

Source

pub fn sample_flow(&mut self, fleet: Option<Fleet>)

Re-derive the flow row. Public so the render test can feed it a fold without a store. None draws nothing — before the first flush has folded anything there is no number, and a row of zeroes would say the box served nobody today, which is a claim and not an absence.

A silent tenant is a WARN row for the same reason a suspended one is: it is revenue that has stopped arriving, and it is the one an operator can still do something about.

Source

pub fn sample_replication(&mut self, report: &ReplicationReport)

Re-derive the standby rows, and raise the staleness alarm.

Public so a render test can feed it a report without a replicator — which is the only way the never row can be asserted at all, since a standby that has never synced is precisely a standby nobody can stand up in a test.

Source

pub fn sample_index(&mut self, facts: &[IndexFacts], now: Instant)

Re-derive the index rows from the engine’s counters. Public so a test can feed it facts without an engine.

Source

pub fn sample(&mut self)

Re-read every header fact from the kernel.

Source

pub fn push(&mut self, row: Row)

Append a row, dropping the oldest past EVENT_ROWS.

Source

pub fn take(&mut self, line: &LogLine)

Take one logged line in, if it is one the screen shows.

Source

pub fn render_frame(&self, cols: usize, rows: usize) -> String

The whole frame: cursor home, every row padded to cols - 1, closed with ESC[K (erase to end of line) and joined with \r\n, exactly rows rows. cols - 1 and not cols: a full-width row leaves the VT’s deferred-wrap flag set and the next \n would then eat a line. ESC[K is what clears the LAST column the padding never reaches: MEASURED on UpCloud 2026-08-29, column 80 kept stale glyphs of the serve log the band overpainted. Erase-to-EOL clears it without writing a character there, so the wrap flag stays clear.

Trait Implementations§

Source§

impl Clone for Screen

Source§

fn clone(&self) -> Self

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 Screen

Source§

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

Formats the value using the given formatter. 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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more