A comprehensive cross-platform system monitoring dashboard built with sysinfo and eframe/egui. Features real-time system statistics, historical data visualization, process management, and extensive customization options.
- CPU Monitoring: Global CPU usage with per-core breakdown
- Memory Monitoring: Detailed memory statistics (used, free, total, available, swap) with visual progress bars
- Disk Monitoring: Per-disk usage statistics with mount points and file systems
- Network Monitoring: Per-interface network statistics with human-readable formatting (KB/MB/GB)
- Process Management: Comprehensive process list with search, filter, and management capabilities
- Historical Data & Charts: Time-series visualization of CPU and memory usage trends using
egui_plot - Process Search & Filter: Real-time filtering by name, CPU threshold, and memory threshold
- Process Details: Expandable process information showing command line, start time, parent PID
- Process Actions: Kill/terminate processes with confirmation dialogs
- Per-CPU Display: Individual CPU core usage percentages with progress bars
- Color-Coded Thresholds: Visual indicators (π’π‘π΄) for CPU and memory usage levels
- Theme Support: Dark and light themes with persistence
- Window Persistence: Saves and restores window size and position
- Export Functionality: Export system statistics to JSON or CSV format
- Configuration File: Persistent settings via
config.tomlfile - Manual Refresh: On-demand refresh button with last refresh timestamp
- Sortable Process Tables: Click column headers to sort processes by name, CPU%, or memory
- Conditional repainting (only when data changes)
- Optimized process list sorting (no unnecessary cloning)
- Minimized mutex lock duration for better concurrency
- Synchronized refresh intervals between UI and background thread
src/system.rs: Contains theSystemMonitorstruct which wrapssysinfo::System, providing methods for querying CPU, memory, disk, network, and process informationsrc/main.rs: The main application usingRustDashboardApp, which:- Spawns a background thread to refresh system data
- Renders a GUI using
eframe/egui - Manages UI state, historical data, and user interactions
src/config.rs: Configuration management module for persistent settingssrc/error.rs: Custom error types usingthiserrorfor better error handlingsrc/lib.rs: Library exports for usingSystemMonitoras a library
- Background thread periodically refreshes
SystemMonitordata - UI thread reads latest data from
SystemMonitor(with minimal lock duration) - Historical data stored in
VecDequefor chart visualization - User interactions (search, filter, sort) applied to process lists
- Configuration persisted to
config.tomlon changes
- Rust 1.60+ (2024 edition)
- Dependencies (automatically managed by Cargo):
sysinfo = "0.33.1"eframe = "0.31.1"(with wgpu feature)log = "0.4"andenv_logger = "0.11"for loggingthiserror = "1.0"for error handlingegui_plot = "0.31"for chartsserde = "1.0"andserde_json = "1.0"for exportcsv = "1.3"for CSV exporttoml = "0.8"anddirs = "5.0"for configuration
-
Clone or download this repository:
git clone <repository-url> cd Rust-Dashboard
-
Build and run:
cargo run
This will compile and launch the dashboard.
-
For release build (optimized):
cargo build --release ./target/release/Rust-Dashboard
The dashboard automatically starts monitoring your system. Use the controls in the top panel:
- Refresh Interval: Select how often data refreshes (1s, 2s, 5s, 10s, 15s, 30s)
- Manual Refresh: Click the π button to refresh immediately
- Theme Toggle: Switch between dark (π) and light (βοΈ) themes
- Last Refresh: See when data was last updated
- Search Processes: Type in the search box to filter by process name
- Filter by Threshold: Use sliders to filter by CPU% or Memory (MB)
- View Details: Click on a process name to expand and see details (command, start time, parent PID)
- Sort Processes: Click column headers (Name, CPU%, Memory MB) to sort
- Kill Process: Click "Kill" button and confirm in the dialog
Click "π₯ Export to JSON" or "π₯ Export to CSV" to export current system statistics. Data includes:
- CPU usage
- Memory statistics
- Process list with CPU and memory usage
- Timestamp
Settings are automatically saved to config.toml in your platform's config directory:
- macOS:
~/Library/Application Support/rust-dashboard/config.toml - Linux:
~/.config/rust-dashboard/config.toml - Windows:
%APPDATA%\rust-dashboard\config.toml
Settings include:
- Refresh interval
- Theme preference
- Window size and position
Control log verbosity using the RUST_LOG environment variable:
# Debug level (most verbose)
RUST_LOG=debug cargo run
# Info level (default)
RUST_LOG=info cargo run
# Warning and errors only
RUST_LOG=warn cargo runThe SystemMonitor can be used as a library:
use rust_dashboard_lib::system::SystemMonitor;
let mut monitor = SystemMonitor::new();
monitor.refresh();
let cpu_usage = monitor.global_cpu_usage();
let (used, free, total, avail, swap_used, swap_total) = monitor.memory_info();
let processes = monitor.combined_process_list();See examples/basic_usage.rs for a complete example.
# Run the basic usage example
cargo run --example basic_usageRun all tests:
cargo testTest coverage includes:
- System monitoring functionality
- Configuration management
- Export functionality
- Process management
- Concurrent access patterns
- Edge cases and error conditions
cargo buildcargo build --releaseRelease builds include:
- Maximum optimization (
opt-level = 3) - Link-time optimization (LTO)
- Stripped binaries for smaller size
The project includes GitHub Actions CI/CD pipeline (.github/workflows/ci.yml) that:
- Runs tests on push/PR
- Builds for Linux, macOS, and Windows
- Checks code formatting
- Runs clippy lints
Rust-Dashboard/
βββ src/
β βββ main.rs # Main application and UI
β βββ lib.rs # Library exports
β βββ system.rs # System monitoring logic
β βββ config.rs # Configuration management
β βββ error.rs # Custom error types
βββ examples/
β βββ basic_usage.rs # Example usage
βββ tests/
β βββ test_system.rs # System tests
β βββ test_config.rs # Config tests
β βββ test_export.rs # Export tests
β βββ test_process_actions.rs # Process action tests
βββ .github/
β βββ workflows/
β βββ ci.yml # CI/CD pipeline
βββ Cargo.toml # Dependencies and build config
βββ README.md # This file
- β Proper logging system replacing debug prints
- β Comprehensive error handling with custom error types
- β Synchronized refresh intervals between UI and background thread
- β Consistent memory unit display (GiB)
- β Optimized process list sorting (no cloning)
- β Conditional repainting (only when data changes)
- β Minimized mutex lock duration
- β Historical data visualization with charts
- β Process search and filtering
- β Human-readable network statistics
- β Expandable process details
- β Process kill/terminate with confirmation
- β Dark/light theme support
- β Window persistence
- β JSON/CSV export
- β Per-CPU usage display
- β Color-coded thresholds
- β Configuration file support
- β Expanded test coverage (41 tests)
- β Tests for error conditions and edge cases
- β Concurrent access tests
- β Integration tests
- β Grid layout for better organization
- β Visual progress bars
- β Sortable process tables
- β Manual refresh with timestamp
- β Visual health status indicators
- Disk I/O Statistics: Not available in
sysinfo0.33.1. The Disk API only provides space information, not read/write speeds or I/O operations per second. - Process Termination: The
terminate()method is not available in sysinfo. Onlykill()(SIGKILL) is supported.
Contributions are welcome! Please ensure:
- Code follows Rust style guidelines
- All tests pass (
cargo test) - Code is formatted (
cargo fmt) - No clippy warnings (
cargo clippy)
[Add your license here]