Convert Figma logo to code with AI

cjbassi logoytop

A TUI system monitor written in Rust

2,155
84
2,155
52

Top Related Projects

26,263

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.

19,111

A monitor of resources

6,293

htop - an interactive process viewer

9,759

Yet another cross-platform graphical process/system monitor.

4,055

Terminal-based CPU stress and monitoring utility

9,693

System monitoring dashboard for terminal

Quick Overview

ytop is a TUI (Text-based User Interface) system monitor written in Rust. It provides a visually appealing and interactive way to monitor system resources such as CPU, memory, disk, and network usage in real-time directly from the terminal.

Pros

  • Lightweight and fast due to being written in Rust
  • Cross-platform support (Linux, macOS, and Windows)
  • Customizable interface with different color schemes
  • Interactive features like process sorting and filtering

Cons

  • Limited configuration options compared to some other system monitors
  • May not provide as detailed information as more specialized monitoring tools
  • Requires terminal with Unicode support for optimal display
  • No longer actively maintained (archived repository)

Getting Started

To install ytop, you can use one of the following methods:

  1. Using Cargo (Rust's package manager):

    cargo install ytop
    
  2. On macOS using Homebrew:

    brew install ytop
    
  3. On Arch Linux using yay:

    yay -S ytop
    

Once installed, simply run ytop in your terminal to start the system monitor.

Competitor Comparisons

26,263

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.

Pros of Glances

  • More comprehensive system monitoring with support for a wider range of metrics and plugins
  • Cross-platform compatibility (Linux, macOS, Windows) and web-based interface
  • Actively maintained with frequent updates and a larger community

Cons of Glances

  • Higher resource usage due to its extensive feature set
  • Steeper learning curve for configuration and customization
  • More complex installation process, especially for non-Linux systems

Code Comparison

Glances (Python):

from glances_api import Glances

glances = Glances()
cpu_percent = glances.getCpu()
print(f"CPU Usage: {cpu_percent}%")

ytop (Rust):

use ytop::cpu::Cpu;

let cpu = Cpu::new();
let usage = cpu.get_usage();
println!("CPU Usage: {}%", usage);

Both projects aim to provide system monitoring capabilities, but they differ in their approach and target audience. Glances offers a more feature-rich and extensible solution, while ytop focuses on simplicity and performance. Glances is better suited for users who need detailed system information and are comfortable with more complex setups, whereas ytop is ideal for those who prefer a lightweight, easy-to-use tool with a clean interface.

19,111

A monitor of resources

Pros of btop

  • More comprehensive system monitoring, including network and disk I/O
  • Customizable interface with themes and layout options
  • Actively maintained with regular updates and bug fixes

Cons of btop

  • Higher resource usage due to more features and graphical elements
  • Steeper learning curve for configuration and customization
  • May be overkill for users seeking simple system monitoring

Code Comparison

ytop:

pub fn get_cpu_data() -> Result<Vec<f64>, std::io::Error> {
    let cpu = sys_info::cpu_num().unwrap();
    let load = sys_info::loadavg()?;
    Ok(vec![load.one, load.five, load.fifteen])
}

btop:

vector<float> Cpu::get_cpu_speeds(void) {
    vector<float> speeds;
    for (const auto& cpu : cpus) {
        speeds.push_back(cpu.current_freq);
    }
    return speeds;
}

Summary

btop offers a more feature-rich and customizable system monitoring experience compared to ytop. However, this comes at the cost of higher resource usage and complexity. ytop provides a simpler, lightweight alternative for basic system monitoring needs. The code comparison shows different approaches to retrieving CPU data, with btop using a more detailed, per-core method.

6,293

htop - an interactive process viewer

Pros of htop

  • More mature and widely used project with a larger community
  • Supports a broader range of Unix-like systems, including Linux, FreeBSD, and macOS
  • Offers more detailed system information and process management capabilities

Cons of htop

  • Written in C, which may be less approachable for some developers compared to Rust
  • User interface is less modern and visually appealing
  • Slower development cycle and less frequent updates

Code Comparison

htop (C):

void Process_writeCommand(Process* this, int writeCommons) {
   if (this->comm && (Process_isUserlandThread(this) || writeCommons)) {
      xSnprintf(this->cmdline, sizeof(this->cmdline), "%s", this->comm);
   } else if (this->st_exe && *this->st_exe) {
      xSnprintf(this->cmdline, sizeof(this->cmdline), "%s", this->st_exe);
   }
}

ytop (Rust):

pub fn new() -> Result<Self> {
    let mut cpu = Cpu::new()?;
    cpu.set_data_collector(Box::new(CpuDataCollector::new()?));
    Ok(Self { cpu })
}

While both projects serve similar purposes, htop is more established and feature-rich, whereas ytop offers a modern, Rust-based alternative with a sleeker interface but fewer advanced features.

9,759

Yet another cross-platform graphical process/system monitor.

Pros of bottom

  • More actively maintained with frequent updates
  • Cross-platform support (Windows, macOS, Linux)
  • Customizable UI with themes and color schemes

Cons of bottom

  • Larger binary size and potentially higher resource usage
  • Steeper learning curve due to more advanced features

Code comparison

ytop:

pub fn new() -> Result<Cpu, Error> {
    Ok(Cpu {
        cpu_count: num_cpus::get(),
        prev_idle: vec![0; num_cpus::get()],
        prev_non_idle: vec![0; num_cpus::get()],
    })
}

bottom:

pub fn init() -> Result<Self> {
    let sys = System::new_all();
    let num_cpus = sys.cpus().len();
    Ok(Cpu {
        sys,
        num_cpus,
        cpu_data: vec![CpuData::default(); num_cpus],
    })
}

Both projects are system monitoring tools written in Rust. ytop is simpler and more lightweight, while bottom offers more features and customization options. ytop's code focuses on basic CPU information, whereas bottom initializes a more comprehensive system monitoring structure. bottom's active development and cross-platform support make it a more versatile choice, but it may be overkill for users seeking a minimalist solution.

4,055

Terminal-based CPU stress and monitoring utility

Pros of s-tui

  • Written in Python, making it more accessible for contributions and modifications
  • Provides more detailed CPU information, including frequency and temperature
  • Offers a stress test feature for CPU performance evaluation

Cons of s-tui

  • Less visually appealing interface compared to ytop's modern design
  • Limited to CPU monitoring, while ytop covers multiple system resources
  • Slower refresh rate and potentially higher resource usage due to Python implementation

Code Comparison

s-tui (Python):

def get_cpu_freq():
    cpu_freq = psutil.cpu_freq()
    return cpu_freq.current if cpu_freq else None

ytop (Rust):

fn get_cpu_usage() -> f64 {
    let cpu = sys.cpu_usage();
    cpu.round()
}

Summary

s-tui focuses on detailed CPU monitoring with stress testing capabilities, while ytop provides a more comprehensive system overview with a modern interface. s-tui's Python implementation makes it more accessible for modifications but may result in slower performance compared to ytop's Rust-based design. The choice between the two depends on specific monitoring needs and preference for either detailed CPU information or a broader system overview.

9,693

System monitoring dashboard for terminal

Pros of gtop

  • Written in JavaScript, making it more accessible for web developers
  • Supports custom color themes
  • Includes a Docker stats view

Cons of gtop

  • Generally slower performance compared to ytop
  • Less detailed CPU and memory usage information
  • Limited customization options for displayed metrics

Code Comparison

gtop (JavaScript):

const si = require('systeminformation');
const blessed = require('blessed');
const contrib = require('blessed-contrib');

// Main application logic

ytop (Rust):

use crossterm::event::{self, Event, KeyCode};
use std::io;
use std::time::Duration;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Main application logic
}

Key Differences

  • ytop is written in Rust, offering better performance and lower resource usage
  • gtop provides a Docker stats view, which is not available in ytop
  • ytop offers more detailed CPU and memory usage information
  • gtop supports custom color themes, while ytop has limited theming options
  • ytop has a more modern and polished user interface

Both tools serve as system monitors with real-time updates, but they cater to different user preferences and requirements. ytop is generally faster and more resource-efficient, while gtop offers some unique features like Docker stats and custom themes.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

NO LONGER MAINTAINED. For a similar program, check out https://github.com/ClementTsang/bottom.

ytop

Minimum rustc version Matrix

Another TUI based system monitor, this time in Rust!

Missing features

  • macOS is missing disk io counters and process commandline
  • Process filtering isn't implemented
  • Mouse usage isn't implemented
  • FreeBSD is currently unsupported

Installation

ytop currently works on Linux and macOS with support planned for all major platforms.

Package managers

Packaging status

AUR

ytop is available in three different AUR packages: ytop, ytop-bin, and ytop-git.

COPR

ytop is also available in COPR:

sudo dnf copr enable atim/ytop -y
sudo dnf install ytop

Homebrew

brew tap cjbassi/ytop
brew install ytop

Prebuilt binaries

Prebuilt binaries are provided in the releases tab.

From source

cargo install ytop

Usage

Keybinds

  • Quit: q or <C-c>
  • Pause: <Space>
  • Process navigation:
    • k and <Up>: up
    • j and <Down>: down
    • <C-u>: half page up
    • <C-d>: half page down
    • <C-b>: full page up
    • <C-f>: full page down
    • gg and <Home>: jump to top
    • G and <End>: jump to bottom
  • Process actions:
    • <Tab>: toggle process grouping
    • dd: kill selected process or process group
  • Process sorting:
    • p: PID/Count
    • n: Command
    • c: CPU
    • m: Mem
  • Process filtering:
    • /: start editing filter
    • (while editing):
      • <Enter>: accept filter
      • <C-c> and <Escape>: clear filter
  • CPU and Mem graph scaling:
    • h: scale in
    • l: scale out
  • ?: toggles keybind help menu

Mouse

  • click to select process
  • mouse wheel to scroll through processes

Colorschemes

ytop ships with a few colorschemes which can be set with the -c flag followed by the name of one. You can find all the colorschemes in the colorschemes folder.

To make a custom colorscheme, copy one of the default ones to ~/.config/ytop/<new-name>.json and load it with ytop -c <new-name>. Colorscheme PRs are welcome!

CLI Options

USAGE:
    ytop [FLAGS] [OPTIONS]

FLAGS:
    -a, --average-cpu    Show average CPU in the CPU widget
    -b, --battery        Show Battery widget (overridden by 'minimal' flag)
    -f, --fahrenheit     Show temperatures in fahrenheit
    -h, --help           Prints help information
    -m, --minimal        Only show the CPU, Mem, and Process widgets
    -p, --per-cpu        Show each CPU in the CPU widget
    -s, --statusbar      Show a statusbar with the time
    -V, --version        Prints version information

OPTIONS:
    -c, --colorscheme <colorscheme>    Set a colorscheme [default: default]
    -i, --interface <interface>        The name of the network interface to show in the Net widget. 'all' shows all
                                       interfaces [default: all]
    -I, --interval <interval>          Interval in seconds between updates of the CPU and Mem widgets. Can specify
                                       either a whole number or a fraction with a numerator of 1 [default: 1]

Related projects