Skip to main content

App

Struct App 

Source
struct App {
Show 26 fields src: Source, tab: Tab, win: usize, limit: usize, filter: String, filter_undo: String, mode: Mode, rows: Vec<Yaml>, sel: usize, names: Vec<Yaml>, nsel: usize, series: Vec<Yaml>, ssel: usize, on_series: bool, trace: Option<Trace>, frame: Option<FrameView>, map: Option<MapView>, alerts: Vec<Yaml>, diag: Option<Yaml>, psel: usize, tail: bool, scroll: usize, stats: String, status: String, err: bool, job: Option<Job>,
}

Fields§

§src: Source§tab: Tab§win: usize§limit: usize§filter: String§filter_undo: String

The filter as it was before / was pressed, so Esc can put it back.

§mode: Mode§rows: Vec<Yaml>§sel: usize§names: Vec<Yaml>§nsel: usize§series: Vec<Yaml>§ssel: usize§on_series: bool

Which metrics pane the arrow keys drive.

§trace: Option<Trace>§frame: Option<FrameView>

The frame and map panes, and the one cursor they share — only one of the two is ever on screen, and both are lists of things Enter acts on.

§map: Option<MapView>§alerts: Vec<Yaml>

The alert list shares the same cursor: it is the third pane that is a list of things Enter acts on, and only one of the three is ever drawn.

§diag: Option<Yaml>

The whole /api/v1/stats document, rendered rather than destructured — a field added to the endpoint should appear here without a code change.

§psel: usize§tail: bool

Re-run the list query on a timer instead of blocking on a key.

§scroll: usize§stats: String§status: String§err: bool§job: Option<Job>

Implementations§

Source§

impl App

Source

fn new(src: Source) -> App

Source

fn reload(&mut self)

Source

fn run(&mut self, job: Job, h: usize)

Source

fn rows_query(&self) -> String

Source

fn frame_query(&self) -> String

The same filter the list is showing, expanded into a frame.

traces then peers, in that order and not the other: traces measures the real extent of what was found, and peers then reads the services inside it. Reversed, peers runs against the window the rows happened to land in and finds only what is already on screen.

No limit: a frame is bounded by the engine’s own entity and trace caps and says so in truncated, which is a different question from how many rows this pane can draw.

Source

fn window_query(&self) -> String

Source

fn series_query(&self) -> String

Source

fn ignored_word(&self) -> Option<String>

A word in the filter that this tab has nowhere to put.

Only metrics can produce one — every other tab reads a bare word as free text. The one thing that must not happen is silence: the filter bar goes on showing the word, so the rows look filtered when they are not.

Source

fn terms(&self, j: &mut Json)

Source

fn key(&mut self, k: Key, h: usize) -> bool

Handle one key. false means quit.

Source

fn follow_pick(&mut self)

Enter, in the frame or map pane.

Everything in either pane is a link back into an ordinary query, which is what the algebra’s closure buys (section 7.3): there is nothing selectable here that lands the reader somewhere they cannot then filter.

Source

fn follow_alert(&mut self)

Enter, on an alert: show the records the rule counted.

The rule’s where terms come back from the API already spelled in the filter-bar grammar (alert::filter_of), so this is an assignment rather than a translation — the alert and the query it fired on cannot drift into two different filters, because there is only one spelling of them. The window is left alone: over is how the rule counts, and a reader who has just been paged usually wants more history than that, not less.

Source

fn pick(&self) -> Option<Pick>

What the frame or map cursor is pointing at.

Source

fn filter_key(&mut self, k: Key) -> bool

Source

fn go(&mut self, tab: Tab)

Source

fn move_by(&mut self, d: isize)

Move whichever cursor the current pane owns.

One function rather than one per view because every view’s list is a selected index plus a length, and the clamping is the part that is easy to get wrong twice.

Clamped in usize, not isize. The scrolling panes report their length as usize::MAX — see cursor — and that is a negative isize, so an isize clamp reads its own upper bound as below its lower bound and panics. j in the detail pane is the keystroke that did it.

Source

fn move_to(&mut self, n: usize)

Source

fn cursor(&self) -> (usize, usize)

Source

fn set_cursor(&mut self, n: usize)

Source

fn open_trace(&mut self)

Follow whatever trace the selection points at.

This is the correlation story as one keystroke: a log line carries the trace_id of the request that emitted it, a span carries its own, and a metric exemplar carries the id of the request that produced the measurement. Three different tabs, one key, because to the person looking it is the same question.

Source

fn selected(&self) -> Option<&Yaml>

Source

fn frame(&mut self, w: usize, h: usize) -> Vec<String>

Source

fn tabbar(&self, w: usize) -> String

Source

fn filterbar(&self, w: usize) -> String

Source

fn statusbar(&self, w: usize) -> String

Source

fn hints(&self, w: usize) -> String

Source

fn records(&self, w: usize, h: usize) -> Vec<String>

Logs and traces: a list on top, the selection’s detail below.

Source

fn detail_full(&self, w: usize) -> Vec<String>

Source

fn metrics(&self, w: usize, h: usize) -> Vec<String>

Metric names on the left, the selected name’s series on the right.

Source

fn series_lines(&self, w: usize) -> Vec<String>

Three lines per series: its attributes, its sparkline, its exemplars.

Pre-rendered as plain strings and then windowed by the caller, because the vertical scroll is over series and each one is a fixed three rows.

Source

fn frame_pane(&self, w: usize, h: usize) -> Vec<String>

The frame: the window it measured, the services in it, the traces in it.

Source

fn map_pane(&self, w: usize, h: usize) -> Vec<String>

The service map, as a call tree rooted at entry.

Source

fn alerts_pane(&self, w: usize, h: usize) -> Vec<String>

Every rule this node evaluates, firing or not.

Quiet rules are listed as prominently as loud ones. An alerting screen that shows only what is on fire cannot answer the question an operator actually has at 3am — “is the rule I wrote for this even running?” — and an empty screen then means both “all clear” and “nothing is watching”.

Source

fn diag_pane(&self, w: usize) -> Vec<String>

What this node counts about itself: /api/v1/stats, laid out.

Every number here is one the ingest path already keeps or the filesystem already knows, so opening this pane costs a readdir and nothing else — a diagnostics screen that perturbs what it measures is worse than none. mmap residency is deliberately absent: mincore over a week of blocks is thousands of syscalls per refresh, and the page cache is the OS’s to report. ponytail: add it per-block behind an explicit key if a hit rate ever turns out to be the question someone is actually asking.

Source

fn waterfall(&self, w: usize, h: usize) -> Vec<String>

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§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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
§

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

§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

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

impl<L> LayerExt<L> for L

§

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

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

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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