Skip to content

An efficient CPU monitor. Built in Rust using egui, eframe, and sysinfo.

Notifications You must be signed in to change notification settings

Junny20/CPU-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPU Monitor

A real-time CPU monitoring application built with Rust.

Tracks overall CPU usage and individual core performance with multi producer single consumer channels.

Screenshots in reverse chronological order

1.0 Finalized Version Added new workers and process count Added progress bar and scrolling mechanism Changed layout and added ema functionality Added_colour and dotted lines Cores with per core rolling graphs Cores with progress bar

Requirements

  • Rust 1.70 or later
  • Windows/Linux/macOS (any platform supported by sysinfo)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/cpu-monitor.git
    cd cpu-monitor
  2. Build the project:

    cargo build --release

Usage

Run the application:

cargo run --release

The GUI will open showing:

  • Overall CPU usage with progress bar and graph
  • Per-core CPU usage for each processor
  • Current process count
  • System information panel

Snapshots update every 100ms. If you wish to change this, change the const REFRESH_MILLISECONDS in src/config/app_variables.

Architecture

The application is structured as follows:

  • Main entry point (src/main.rs): Sets up communication channels and starts background workers
  • App logic (src/app/): Handles GUI updates, state management, and data processing
  • Workers (src/workers/): Background threads collecting CPU, process, and system data
  • Snapshots (src/snapshots/): Data structures for system information
  • Graph rendering (src/graph/): Drawing utilities for charts and progress bars
  • Configuration (src/config/): Constants for layout, styling, and behavior

Data flows from background workers through multi-producer-single-consumer channels to the main GUI thread.

Dependencies

  • eframe: For the GUI framework
  • egui: UI components and rendering
  • sysinfo: System information collection
  • std::sync::mpsc: Inter-thread communication

Known Issues

  • On Windows, the GUI is in light mode while on MacOS the GUI is in dark mode.
  • On MacOS, the number of processes shown will be different than that in the Activity Monitor, this is because MacOS often bundles together related processes as one.

License

MIT License

Acknowledgments

Built with Rust, egui, and sysinfo. c:\Users\liujo\OneDrive\Documents\CPU-Monitor\README.md

About

An efficient CPU monitor. Built in Rust using egui, eframe, and sysinfo.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages