A high-performance, feature-rich system monitoring tool for macOS with special optimizations for Apple Silicon chips. This tool provides real-time system metrics with an intuitive terminal user interface, smart notifications, and comprehensive configuration options.
System Alert is a professional-grade system monitoring application designed specifically for macOS, with enhanced support for Apple Silicon processors. It offers real-time monitoring of CPU, memory, battery, temperature, network, and power consumption with a beautiful terminal-based interface.
- ๐ Advanced Battery Monitoring: Real-time battery health, cycle count, and charging status
- โก Apple Silicon Optimization: E-cluster/P-cluster monitoring with detailed power metrics
- ๐จ Beautiful TUI Interface: Clean, organized four-quadrant layout with progress bars
- ๐ Real-time Data: Live system metrics with configurable refresh rates
- ๐ Smart Notifications: Configurable threshold-based alerts
- โ๏ธ Highly Configurable: TOML-based configuration with CLI overrides
- Async Architecture: Non-blocking data collection using Tokio
- Smart Caching: PowerMetrics data cached for optimal performance
- Efficient Memory Management: Reduced allocations and optimized data structures
- Selective Refresh: Only refresh necessary system components
- Optimized Build: Release profile with LTO, size optimization, and panic=abort
- Four-Quadrant Layout: Brand new sectioned layout with clear information grouping
- Interactive Controls: Keyboard navigation, notification toggle, manual refresh
- Smart Notifications: Configurable thresholds with cooldown periods
- Visual Power Monitor: Beautiful bordered display with progress bars
- Minimal Mode: Lightweight display for resource-constrained scenarios
- Configuration Management: TOML-based config files with CLI overrides
- Apple Silicon Metrics: E-cluster/P-cluster monitoring with power analysis
- Temperature Monitoring: Component temperature tracking with smart status indicators
- Process Analysis: Top processes by CPU usage with detailed information
- Network Statistics: Real-time network traffic monitoring
- Real-time Power Statistics: Dedicated power consumption analysis
- macOS: 10.15+ (Optimized for Apple Silicon)
- Root Privileges: Required for accessing system metrics via
powermetrics
- Rust: 1.70+ (Required for building from source)
git clone https://github.com/yourusername/system-alert.git
cd system-alert
cargo build --release
# Run with default settings
sudo cargo run
# Run with custom refresh rate
sudo cargo run -- --refresh 2
# Run in minimal mode
sudo cargo run -- --minimal
# Run with custom config
sudo cargo run -- --config custom-config.toml
sudo ./target/release/system-alert [options]
Options:
-r, --refresh <seconds> Set refresh rate (default: 1)
-m, --minimal Use minimal display mode
-c, --config <file> Specify custom config file
-h, --help Show help message
-V, --version Show version information
- q or Ctrl+C: Quit application
- n: Toggle notifications
- r: Force refresh
The application features a modern four-quadrant layout:
-
๐ต CPU Section (Top Left):
- CPU core usage with individual core monitoring
- Apple Silicon E-cluster/P-cluster metrics
- Real-time frequency and power consumption
-
๐ด Power Monitor (Top Right):
- Battery status with health percentage
- Charging state and time remaining
- Power adapter wattage and cycle count
- Comprehensive power analytics
-
๐ข Memory Monitor (Bottom Left):
- RAM usage with detailed breakdown
- Swap memory statistics
- Memory pressure indicators
-
๐ก Temperature Monitor (Bottom Left):
- Component temperature readings
- Thermal throttling status
- Fan speed monitoring
-
๐ฃ Process Monitor (Bottom Right):
- Top processes by CPU usage
- Memory consumption per process
- Real-time process statistics
-
๐ต Network Monitor (Bottom Right):
- Network interface statistics
- Bytes transmitted/received
- Packet counts and rates
The application will create a config.toml
file with sensible defaults:
# System Monitor Configuration
refresh_rate = 1
minimal_mode = false
[thresholds]
cpu_warning = 75.0
cpu_critical = 90.0
memory_warning = 75
memory_critical = 90
temperature_warning = 70.0
temperature_critical = 85.0
[display]
show_temperatures = true
show_network = true
show_processes = true
show_history = true
history_size = 60
[notifications]
enabled = true
cooldown_seconds = 30
refresh_rate
: Update interval in secondsminimal_mode
: Enable simplified interface
cpu_warning/critical
: CPU usage alert thresholds (%)memory_warning/critical
: Memory usage alert thresholds (%)temperature_warning/critical
: Temperature alert thresholds (ยฐC)
show_temperatures
: Enable temperature monitoringshow_network
: Enable network interface monitoringshow_processes
: Enable process monitoringshow_history
: Enable historical data trackinghistory_size
: Number of data points to retain
enabled
: Enable/disable system notificationscooldown_seconds
: Minimum time between notifications
Optimized architecture with separation of concerns for better maintainability and performance:
src/
โโโ main.rs # Application entry point with async event loop
โโโ cli.rs # Command line parsing and input handling
โโโ config.rs # Configuration management (TOML)
โโโ data_collector.rs # Async system data collection
โโโ battery_collector.rs # Advanced battery data collection
โโโ ui.rs # Terminal user interface (TUI)
โโโ notification.rs # Smart notification system
โโโ history.rs # Historical data tracking
โโโ types.rs # Data structures and types
โโโ system_info.rs # Legacy compatibility module
- Separation of Concerns: Clear separation between UI, data collection, and business logic
- Async/Await: Non-blocking operations throughout
- Error Handling: Comprehensive error handling without panics
- Memory Efficiency: Reduced allocations and better data structures
- Configurability: Extensive configuration options
- Extensibility: Modular design for easy feature addition
[profile.release]
strip = true # Remove debug symbols
opt-level = "z" # Optimize for size
lto = true # Link-time optimization
codegen-units = 1 # Single codegen unit for better optimization
panic = "abort" # Smaller binary size
- PowerMetrics Caching: Reduce expensive system calls
- Selective Data Refresh: Only update changed components
- Efficient String Handling: Minimize allocations in hot paths
- Smart Rendering: Only redraw when necessary
- Async I/O: Non-blocking system calls
Permission Denied
# Make sure to run with sudo
sudo cargo run
PowerMetrics Not Found
# Verify powermetrics is available (macOS only)
which powermetrics
High CPU Usage
# Increase refresh rate to reduce system load
sudo cargo run -- --refresh 5
Configuration Issues
# Reset to defaults by removing config file
rm config.toml
sudo cargo run
For Apple Silicon Macs, this tool provides detailed metrics:
- E-Cluster: Efficiency core usage and frequency
- P-Cluster: Performance core usage and frequency
- Power Consumption: CPU, GPU, ANE (Neural Engine), and total package power
- Real-time Monitoring: Live updates of power states
Contributions are welcome! Feel free to submit issues, feature requests, or pull requests.
git clone https://github.com/yourusername/system-alert.git
cd system-alert
cargo build
cargo test
This project is licensed under the MIT License - see the LICENSE file for details.