pub struct TuiApp { /* private fields */ }Expand description
TUI application state
Implementations§
Source§impl TuiApp
impl TuiApp
Sourcepub fn new(
metrics: MetricsCollector,
router: Arc<BackendSelector>,
servers: Arc<[Server]>,
) -> Self
pub fn new( metrics: MetricsCollector, router: Arc<BackendSelector>, servers: Arc<[Server]>, ) -> Self
Create a new TUI application
Note: Prefer using TuiAppBuilder for more flexibility.
This method is a convenience wrapper.
Sourcepub fn snapshot(&self) -> &MetricsSnapshot
pub fn snapshot(&self) -> &MetricsSnapshot
Get current metrics snapshot
Sourcepub const fn client_throughput_history(&self) -> &VecDeque<ThroughputPoint>
pub const fn client_throughput_history(&self) -> &VecDeque<ThroughputPoint>
Get client throughput history (global)
Sourcepub fn latest_client_throughput(&self) -> Option<&ThroughputPoint>
pub fn latest_client_throughput(&self) -> Option<&ThroughputPoint>
Get latest client throughput
Sourcepub fn backend_pending_count(&self, backend_idx: usize) -> usize
pub fn backend_pending_count(&self, backend_idx: usize) -> usize
Get pending command count for a backend
Sourcepub fn backend_load_ratio(&self, backend_idx: usize) -> Option<f64>
pub fn backend_load_ratio(&self, backend_idx: usize) -> Option<f64>
Get load ratio for a backend (pending / max_connections)
Sourcepub fn backend_stateful_count(&self, backend_idx: usize) -> usize
pub fn backend_stateful_count(&self, backend_idx: usize) -> usize
Get stateful connection count for a backend
Get traffic share percentage for a backend
Sourcepub fn throughput_history(
&self,
backend_idx: usize,
) -> &VecDeque<ThroughputPoint>
pub fn throughput_history( &self, backend_idx: usize, ) -> &VecDeque<ThroughputPoint>
Get throughput history for a backend
§Panics
Panics if backend_idx is out of range for the configured backend history.
Sourcepub fn latest_backend_throughput(
&self,
backend_idx: usize,
) -> Option<&ThroughputPoint>
pub fn latest_backend_throughput( &self, backend_idx: usize, ) -> Option<&ThroughputPoint>
Get latest backend throughput for a backend
Sourcepub const fn log_buffer(&self) -> &Arc<LogBuffer> ⓘ
pub const fn log_buffer(&self) -> &Arc<LogBuffer> ⓘ
Get log buffer for displaying recent log messages
Sourcepub const fn toggle_log_fullscreen(&mut self)
pub const fn toggle_log_fullscreen(&mut self)
Toggle between normal and log fullscreen view
Sourcepub const fn toggle_details(&mut self)
pub const fn toggle_details(&mut self)
Toggle detailed metrics display
Sourcepub const fn show_details(&self) -> bool
pub const fn show_details(&self) -> bool
Get current details display state
Sourcepub const fn system_stats(&self) -> &SystemStats
pub const fn system_stats(&self) -> &SystemStats
Get current system stats (CPU and memory)
Sourcepub const fn buffer_pool(&self) -> Option<&BufferPool>
pub const fn buffer_pool(&self) -> Option<&BufferPool>
Get buffer pool (optional - for monitoring buffer stats)
Sourcepub fn snapshot_state(&self) -> DashboardState
pub fn snapshot_state(&self) -> DashboardState
Build a serializable snapshot of the current dashboard state.
Sourcepub fn snapshot_state_with_log_limit(
&self,
log_limit: Option<usize>,
) -> DashboardState
pub fn snapshot_state_with_log_limit( &self, log_limit: Option<usize>, ) -> DashboardState
Build a serializable snapshot of the current dashboard state with a bounded log tail.
Sourcepub fn snapshot_state_with_limits(
&self,
log_limit: Option<usize>,
history_limit: Option<usize>,
) -> DashboardState
pub fn snapshot_state_with_limits( &self, log_limit: Option<usize>, history_limit: Option<usize>, ) -> DashboardState
Build a serializable snapshot with bounded log and history tails.
Auto Trait Implementations§
impl !RefUnwindSafe for TuiApp
impl !UnwindSafe for TuiApp
impl Freeze for TuiApp
impl Send for TuiApp
impl Sync for TuiApp
impl Unpin for TuiApp
impl UnsafeUnpin for TuiApp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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