A TUI system monitor written in Rust

Related tags

System tools ytop
Overview

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

Comments
  • Crash after running for a while

    Crash after running for a while "overflow when subtracting durations"

    Several times I've had ytop left running and came back to find it crashed with this backtrace:

    Backtrace (most recent call first):
      File "src/libcore/option.rs", line 1185, in core::option::expect_failed
      File "src/libcore/option.rs", line 345, in core::option::Option<T>::expect
      File "src/libcore/time.rs", line 744, in <core::time::Duration as core::ops::arith::Sub>::sub
      File "<unknown>", line 0, in psutil::process::process::Process::cpu_percent
      File "<unknown>", line 0, in <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
      File "<unknown>", line 0, in <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
      File "<unknown>", line 0, in <ytop::widgets::proc::ProcWidget as ytop::update::UpdatableWidget>::update
      File "<unknown>", line 0, in ytop::update::update_widgets
      File "<unknown>", line 0, in ytop::main
      File "<unknown>", line 0, in std::rt::lang_start::{{closure}}
      File "src/libstd/rt.rs", line 48, in std::rt::lang_start_internal::{{closure}}
      File "src/libstd/panicking.rs", line 287, in std::panicking::try::do_call
      File "src/libpanic_unwind/lib.rs", line 78, in __rust_maybe_catch_panic
      File "src/libstd/panicking.rs", line 265, in std::panicking::try
      File "src/libstd/panic.rs", line 396, in std::panic::catch_unwind
      File "src/libstd/rt.rs", line 47, in std::rt::lang_start_internal
      File "<unknown>", line 0, in main
      File "<unknown>", line 0, in __libc_start_main
      File "<unknown>", line 0, in <unknown>
      File "<unknown>", line 0, in <unknown>
    
    The application panicked (crashed).
      overflow when subtracting durations
    in src/libcore/option.rs, line 1185
    thread: main
    
    bug 
    opened by trolley 19
  • macOS support

    macOS support

    Currently rust-psutil is pretty barebones so we need to implement a lot the necessary cross platform functionality. Also, ytop currently only compiles on Linux because only Linux functions are implemented.

    • [x] Refactor rust-psutil to be more modular and allow cross platform functionality: https://github.com/borntyping/rust-psutil/pull/54
    • [x] Implement the functionality on Linux x86
      • [x] temperatures
    • [ ] Implement the functionality on macOS x86
      • [x] cpu percents
      • [x] cpu count
      • [x] memory
      • [ ] temps
      • [ ] disk
      • [x] net
      • [ ] processes
      • [x] battery
    opened by cjbassi 13
  • Fixes missing temperature on mac os

    Fixes missing temperature on mac os

    Hey there,

    I have fixed the missing temperature for mac os by using the same approach as used in the go version of this repo: https://github.com/cjbassi/gotop

    Cheers

    opened by Zarathustra2 12
  • [WIP] Ability to not follow a process

    [WIP] Ability to not follow a process

    This introduces an ability to not-follow a process in the proc widget. I having to do gg whenever I visit ytop to find out the process which is currently using high mem/CPU. It'd be great to have the ability to not always track the currently highlighted process.

    This patch is a POC for that. What it does is:

    • Introduce a new flag on the widget: follow_proc, which is false by default. If it is set to true, the render will always jump to the position for the highlighted position. If it is false, it'll keep the selected position the same, no matter which process lands on it.
    • When ever the user does a scroll action (except gg), ytop will keep track of the process. gg or scroll to top on the other hand, stops the process tracking facilitating a view such as: the current process taking the most resources.
    • Also, bind Esc to set follow_proc as false and disable following of a process.

    I understand this cannot be merged as is, but I'd like to start a discussion. If this makes sense, I'd like suggestions on what can be changed in the patch to merge it in.

    opened by crodjer 8
  • Fix build with tui 0.9

    Fix build with tui 0.9

    Minimal effort changes to make ytop build with tui-0.9.

    Needs some discussion whether proposed approach of Widget ownership/borrowing is fine.

    Fixes #69

    opened by terorie 8
  • Upgrade tui

    Upgrade tui

    We need to upgrade tui for a few features and bug fixes but there is quite a few api changes in the latest release. I've started some work on this in the upgrade-tui branch, but i've just been a little busy with some other things if anybody feels like continuing to work on it. If you make any progress feel free to open a pull request against that branch. Thanks!

    help wanted 
    opened by cjbassi 8
  • With light background unreadable

    With light background unreadable

    image

    Required information:

    • ytop version (ytop -V): ytop 0.5.1
    • The output of uname -a: Linux roman-MS-7B43 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

    Include any of the following information if relevant:

    • Terminal emulator (e.g. iTerm or gnome terminal): gnome terminal
    • tmux version (tmux -V):
    • Any relevenat hardware info:

    Please copy or attach ~/.local/state/ytop/errors.log if it exists and contains logs:

    opened by rofrol 8
  • attempt to multiply with overflow if swap is disabled

    attempt to multiply with overflow if swap is disabled

    repo @ e56403ded6881bc99a5425dc83d32c94e01f8f85 Linux t470 5.4.12-1-MANJARO #1 SMP PREEMPT Wed Jan 15 08:05:08 UTC 2020 x86_64 GNU/Linux terminal is alacritty

    RUST_BACKTRACE=Full ./target/debug/ytop

    Backtrace (most recent call first):
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/canvas/mod.rs", line 106, in tui::widgets::canvas::Context::draw
        let index = dy / 4 * self.width as usize + dx / 2;
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/chart.rs", line 474, in <tui::widgets::chart::Chart<LX,LY> as tui::widgets::Widget>::draw::{{closure}}
        ctx.draw(&Points {
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/canvas/mod.rs", line 255, in <tui::widgets::canvas::Canvas<F> as tui::widgets::Widget>::draw
        painter(&mut ctx);
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/chart.rs", line 469, in <tui::widgets::chart::Chart<LX,LY> as tui::widgets::Widget>::draw
        Canvas::default()
      File "src/widgets/mem.rs", line 96, in <ytop::widgets::mem::MemWidget as tui::widgets::Widget>::draw
        Chart::<String, String>::default()
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/terminal.rs", line 49, in tui::terminal::Frame<B>::render
        widget.draw(area, self.terminal.current_buffer_mut());
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/mod.rs", line 85, in tui::widgets::Widget::render
        f.render(self, area);
      File "src/draw.rs", line 75, in ytop::draw::draw_middle_row
        widgets.mem.render(frame, horizontal_chunks[1]);
      File "src/draw.rs", line 41, in ytop::draw::draw_widgets
        draw_middle_row(frame, widgets, vertical_chunks[1]);
      File "src/draw.rs", line 22, in ytop::draw::draw::{{closure}}
        draw_widgets(&mut frame, &mut app.widgets, chunks[0]);
      File "/home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/terminal.rs", line 140, in tui::terminal::Terminal<B>::draw
        f(self.get_frame());
      File "src/draw.rs", line 11, in ytop::draw::draw
        terminal.draw(|mut frame| {
      File "src/main.rs", line 128, in ytop::main
        draw(&mut terminal, &mut app).unwrap();
    
    The application panicked (crashed).
      attempt to multiply with overflow
    in /home/matthias/.cargo/git/checkouts/tui-rs-7836e4b22d734056/aff0a4c/src/widgets/canvas/mod.rs, line 106
    thread: main
    
    bug os:linux 
    opened by matthiaskrgr 8
  •  index out of bounds: the len is 0 but the index is 3

    index out of bounds: the len is 0 but the index is 3

    Hello,

    After running ytop for a few hours I get this error below. I've encountered it a few times and I'm unsure how to debug it. Is it possible to run ytop with RUST_BACKTRACE=1 as a flag to find the bug?

    Thanks for your work on this app.

    Cheers.

    Info

    ytop 0.6.2

    Darwin rrfd.local 18.7.0 Darwin Kernel Version 18.7.0: Mon Apr 27 20:09:39 PDT 2020; root:xnu-4903.278.35~1/RELEASE_X86_64 x86_64

    Include any of the following information if relevant:

    ProductName: Mac OS X ProductVersion: 10.14.6 BuildVersion: 18G5033

    alacritty 0.5.0-dev (65bff18) tmux 3.1b

    Please copy or attach ~/.local/state/ytop/errors.log if it exists and contains logs:

    Does not exist

    Error Message:

    Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
    Run with RUST_BACKTRACE=full to include source snippets.
    
    The application panicked (crashed).
      index out of bounds: the len is 0 but the index is 3
    in rust:src/libcore/slice/mod.rs, line 2842
    thread: main
    
    opened by robertdefilippi 7
  • Vertical gaps in the graph lines

    Vertical gaps in the graph lines

    I noticed that graphs don't look good on my main machine.

    • Here's how it rendered on an old VM (also using Arch and kitty): vm

    • Here's how it renders on my main machine: main

    The dots characters look way too thin. They should look just like on the README screenshot and the VM screenshot.

    kitty.conf:

    font_family                   JetBrainsMonoMedium Nerd Font
    font_size                     10.5
    bold_font                     auto
    italic_font                   auto
    bold_italic_font              auto
    force_ltr                     no
    adjust_line_height            0
    adjust_column_width           0
    disable_ligatures             cursor
    font_features                 none
    box_drawing_scale             0.001, 1, 1.5, 2
    
    

    .Xresources:

    Xft.dpi: 96
    Xft.antialias: true
    Xft.hinting: true
    Xft.rgba: rgb
    Xft.autohint: false
    Xft.hintstyle: hintfull
    Xft.lcdfilter: lcddefault
    

    .xinitrc:

    xrdb -load ~/.config/X11/.Xresources
    

    I tried using another font with kitty (Fira Code Nerd Font Mono) but it doesn't make any difference.

    Any idea which settings I should tweak in order to get the same rendering than the VM one?

    Thanks.

    opened by ghost 6
  • ytop graphics have broken spacing compared to gotop

    ytop graphics have broken spacing compared to gotop

    ytop graphics have a quirk, the points seem to be improperly spaced when the terminal window is maximized.

    Example:

    This is gotop running at the same time:

    Required information:

    • ytop version (ytop -V): ytop v0.4.2 (https://github.com/cjbassi/ytop#f86926c7)
    • The output of uname -a: Linux Dianakko 5.4.17-1-MANJARO #1 SMP PREEMPT Tue Feb 4 11:40:50 UTC 2020 x86_64 GNU/Linux

    Include any of the following information if relevant:

    • Terminal emulator (e.g. iTerm or gnome terminal): Gnome Terminal 3.34.2
    • tmux version (tmux -V): N/A
    • Any relevenat hardware info: N/A

    Please copy or attach ~/.local/state/ytop/errors.log if it exists and contains logs: N/A

    bug 
    opened by amyspark 6
  • Configuration for things displayed

    Configuration for things displayed

    Configuration to show displayed batteries, temperatures, and mount points

    For example, I might want to exclude my CPU die, or include my mouse battery

    opened by Qwerty-Space 0
  • ytop displays negative temperature value

    ytop displays negative temperature value

    Environment

    $ ytop -V
    ytop 0.6.2
    $ uname -a
    Darwin 549725-mitll 19.6.0 Darwin Kernel Version 19.6.0: Sun Jul  5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64 x86_64
    
    • Software: Mac OS X 10.15.6 (build 19G73), Xcode-11.6, rustc 1.47.0-nightly (cfc572cae 2020-07-30)
    • Any relevenat hardware info: iMac Pro 2019

    ~/.local/state/ytop/errors.log exists, but is empty.

    Problem

    On iMac (but not on older MacBooks) sysinfo provides - and ytop displays - wrong temperature. Note: I cloned sysinfo, and added some sensors (PECI CPU, and a couple more of such) to see what sensors report correctly on both Mac platforms). I found that all of those sensors give correct values on MacBook, but some fail on iMac Pro.

    Screen Shot 2020-08-02 at 21 25 01

    Proposed Workaround

    While we're discussing with @GuillaumeGomez the possibility of fixing sysinfo library - it would be nice if ytop could validate (sanity-check) inputs it receives from it. In this particular case, I'd love if ytop would check the received CPU temperature either against zero, or against CPU Proximity, and if it is lower (i.e., lower than zero, or lower than CPU Proximity) - ignore/drop that value and don't display it.

    Could you do that, please?

    opened by mouse07410 0
  • Document automatic `-a` vs `-p` selection

    Document automatic `-a` vs `-p` selection

    Some people have been rightfully confused (including myself when I first switched to ytop) that some computers will display all CPU cores, vs the average CPU usage. I think it would help if this detection was documented in the --help output next to the -a and -p flags saying something along the lines that it's the default if >= or < 8 cpu cores respectively.

    opened by LovecraftianHorror 0
  • Document minimum supported rust version

    Document minimum supported rust version

    Sadly from what I can tell there's no way to provide information about the minimum supported rust version in Cargo.toml, but there have been a number of issues raised here because of people using outdated compilers and getting build failures (#107 #66 etc.). If a minimum supported rust version was documented in the README and tested against with CI then hopefully people will understand the issue earlier.

    opened by LovecraftianHorror 0
  • run ytop in wsl ubuntu, but doesn`t work

    run ytop in wsl ubuntu, but doesn`t work

    Installed package ytop v0.6.2 (executable ytop) *******> ytop

    Backtrace omitted. Run with RUST_BACKTRACE=1 to display it. Run with RUST_BACKTRACE=full to include source snippets.

    The application panicked (crashed). called Result::unwrap() on an Err value: MissingData { path: "/proc/meminfo", contents: "MemTotal: 16112436 kB\nMemFree: 7029116 kB\nBuffers: 34032 kB\nCached: 188576 kB\nSwapCached: 0 kB\nActive: 167556 kB\nInactive: 157876 kB\nActive(anon): 103104 kB\nInactive(anon): 17440 kB\nActive(file): 64452 kB\nInactive(file): 140436 kB\nUnevictable: 0 kB\nMlocked: 0 kB\nSwapTotal: 13107196 kB\nSwapFree: 12628476 kB\nDirty: 0 kB\nWriteback: 0 kB\nAnonPages: 102824 kB\nMapped: 71404 kB\nShmem: 17720 kB\nSlab: 13868 kB\nSReclaimable: 6744 kB\nSUnreclaim: 7124 kB\nKernelStack: 2848 kB\nPageTables: 2524 kB\nNFS_Unstable: 0 kB\nBounce: 0 kB\nWritebackTmp: 0 kB\nCommitLimit: 515524 kB\nCommitted_AS: 3450064 kB\nVmallocTotal: 122880 kB\nVmallocUsed: 21296 kB\nVmallocChunk: 66044 kB\nHardwareCorrupted: 0 kB\nAnonHugePages: 2048 kB\nHugePages_Total: 0\nHugePages_Free: 0\nHugePages_Rsvd: 0\nHugePages_Surp: 0\nHugepagesize: 2048 kB\nDirectMap4k: 12280 kB\nDirectMap4M: 897024 kB\n" } in /home/ds/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/ytop-0.6.2/src/widgets/mem.rs, line 71 thread: main

    opened by Dongshan-git 7
Releases(0.6.2)
Owner
Caleb Bassi
Matrix: @cjbassi:matrix.org
Caleb Bassi
📊 Fetch & monitor your server's resource usage through Lua

?? gmsv_serverstat Simple serverside binary module which can expose information about system resource usage to Lua. Installation Download the relevant

William 21 Jul 30, 2022
A system handler to get information and interact with processes written in Rust

A system handler to get information and interact with processes written in Rust

Guillaume Gomez 1.1k Jan 3, 2023
A lib crate for gathering system info such as cpu, distro, environment, kernel, etc in Rust.

nixinfo A lib crate for gathering system info such as cpu, distro, environment, kernel, etc in Rust. To use: nixinfo = "0.2.8" in your Cargo.toml. Cur

ValleyKnight 37 Nov 26, 2022
A simple rust-based tool for fetching system information

?? azf a simple rust-based tool for fetching system information you need a patched nerd font and the material design icons font ?? compiling you can c

Pedro Henrique 3 Dec 17, 2022
Basic system information fetcher, with a focus on performance.

Table of Contents: About Changelog Dependencies Benchmarks Features Installation Platform Support About Macchina Macchina lets you view basic system i

null 677 Dec 28, 2022
System Tools with real-time Web UI

HeroicToys The remake of useful CLI tools, but with Web UI. The project uses RillRate - Dynamic UI for bots, microservices, and IoT.

RillRate 27 Nov 10, 2022
System Tools with real-time Web UI

MultiTool System Tools with real-time Web UI. The project uses RillRate - Dynamic UI for bots, microservices, and IoT. Included Implemented: System Mo

RillRate 27 Nov 10, 2022
Cap'n Proto is a type system for distributed systems

Cap'n Proto for Rust documentation blog Introduction Cap'n Proto is a type system for distributed systems. With Cap'n Proto, you describe your data an

Cap'n Proto 1.5k Jan 1, 2023
A modern replacement for ps written in Rust

procs procs is a replacement for ps written in Rust. Documentation quick links Features Platform Installation Usage Configuration Features Output by t

null 3.6k Jan 5, 2023
Blazing 💥 fast terminal-ui for git written in rust 🦀

Blazing fast terminal client for git written in Rust Features Fast and intuitive keyboard only control Context based help (no need to memorize tons of

Stephan Dilly 11.8k Jan 5, 2023
A simple and fast download accelerator, written in Rust

zou A simple and fast download accelerator, written in Rust Zou is a Snatch fork by @k0pernicus. Snatch is a fast and interruptable download accelerat

Antonin Carette 173 Dec 4, 2022
A bash-like Unix shell written in Rust

Cicada Unix Shell Cicada is a simple Unix shell written in Rust. Documents Install cicada Environment Variables Cicada Builtins Completion RC File His

Hugo Wang 921 Dec 28, 2022
Performs distributed command execution, written in Rust w/ Tokio

Concurr: Distributed and Concurrent Command Execution, in Rust This project is dual licensed under MIT and Apache 2.0. Originally inspired by the GNU

Michael Murphy 93 Dec 18, 2022
A non-root version of traceroute written in Rust

tracepath-rs A non-root version of traceroute written in Rust for Linux.

Peter Malmgren 9 Dec 30, 2022
Dancing Links (“dlx”) solver for the exact cover problem, written in Rust. Can be used to create a sudoku solver.

Dancing Links “dlx” Dancing Links solver for “algorithm X” by Knuth This solver solves the exact cover problem using “algorithm X”, implemented using

bluss 4 Nov 19, 2022
LeftHK - A hotkey daemon written in Rust

LeftHK LeftHK - A hotkey daemon written in Rust THIS IS BETA SOFTWARE The configuration file should be created in ~/.config/lefthk/ and called config.

null 15 Oct 12, 2022
minimalistic command launcher in rust

rrun Note: Apart from the occasional fix, this project is not actively developed anymore. rrun works fine and should run/compile for the time being on

null 105 Nov 18, 2022
Yet another fancy watcher. (Rust)

funzzy Yet another fancy watcher. (Inspired by antr / entr) Configure execution of different commands using semantic yaml. # .watch.yaml # list here a

Cristian Oliveira 188 Dec 12, 2022
A more intuitive version of du in rust

Dust du + rust = dust. Like du but more intuitive. Why Because I want an easy way to see where my disk is being used. Demo Install Cargo cargo install

andy.boot 5.5k Jan 8, 2023