Skip to main content

ttop/
lib.rs

1//! ttop library - Terminal Top system monitor
2//!
3//! This module exposes the core components for testing and embedding.
4#![cfg_attr(test, allow(clippy::unwrap_used))]
5#![cfg_attr(test, allow(clippy::field_reassign_with_default))]
6//!
7//! ## Architecture
8//!
9//! The library is organized into several key modules:
10//!
11//! - **app**: Main application state and logic
12//! - **analyzers**: Advanced analysis algorithms (swap thrashing, disk I/O latency, anomaly detection)
13//! - **panels**: TUI panel rendering
14//! - **ring_buffer**: SIMD-optimized time-series data structure
15//! - **state**: UI state management
16//! - **theme**: Color schemes and styling
17//! - **ui**: Main rendering logic
18//!
19//! ## Key Features
20//!
21//! - Swap thrashing detection using Denning's Working Set Model (1968)
22//! - Disk I/O latency estimation using Little's Law (1961)
23//! - Large file anomaly detection using Modified Z-Score (Iglewicz & Hoaglin, 1993)
24//! - ZRAM compression monitoring
25
26pub mod analyzers;
27pub mod app;
28pub mod display_rules;
29pub mod panels;
30pub mod ring_buffer;
31pub mod state;
32pub mod theme;
33pub mod ui;
34
35// Re-export key types for convenience
36pub use analyzers::{
37    DiskIoAnalyzer, IoWorkloadType, LargeFileDetector, StorageAnalyzer, SwapAnalyzer,
38    ThrashingSeverity, ZramStats,
39};
40pub use ring_buffer::{handle_counter_wrap, RingBuffer};