Single-host, read-only system diagnostics TUI. Twelve tabs covering CPU, memory, disks, processes, GPU, power, services, network, plus a Timeline scrubber and an Insights anomaly engine. Sibling to netwatch.
usestd::collections::VecDeque;/// Bounded ring buffer for sparkline history.
#[derive(Debug, Clone)]pubstructRing<T>{cap:usize,
inner:VecDeque<T>,
}impl<T:Clone>Ring<T>{pubfnnew(cap:usize)->Self{Self{
cap,
inner:VecDeque::with_capacity(cap),}}pubfnpush(&mutself, v: T){ifself.inner.len()==self.cap {self.inner.pop_front();}self.inner.push_back(v);}pubfniter(&self)-> impl Iterator<Item = &T>{self.inner.iter()}pubfnlen(&self)->usize{self.inner.len()}pubfnis_empty(&self)->bool{self.inner.is_empty()}pubfnlast(&self)->Option<&T>{self.inner.back()}/// Get the nth element counting back from the most recent (0 = newest).
pubfnnth_back(&self, n:usize)->Option<&T>{let len =self.inner.len();if n >= len {returnNone;}self.inner.get(len -1- n)}pubfnto_vec(&self)->Vec<T>{self.inner.iter().cloned().collect()}}