[ANN] TerminalSystemMonitor.jl: Displays usage of CPU, RAM, and optionally GPU

Introduction

This Julia package TerminalSystemMonitor.jl displays CPU and RAM usage information on your computer.

It should work on many platforms such as Windows, macOS and Linux (including RaspberryPi 4,5 with 64bit OS)
If necessary, you can display the usage of GPU resources.

Installation

julia> using Pkg; Pkg.add("TerminalSystemMonitor.jl")

Basic usage

julia> using TerminalSystemMonitor; monitor()

This should output like below:

╭───────────────────────╮╭───────────────────────╮╭───────────────────────╮
│      ┌               ┐││      ┌               ┐││      ┌               ┐│
│id:  0┤■■ 14           ││id:  4┤ 3              ││id:  8┤ 0              │
│id:  1┤■ 13            ││id:  5┤ 3              ││id:  9┤ 0              │
│id:  2┤■ 7.1           ││id:  6┤ 1              ││id: 10┤ 0              │
│id:  3┤■ 6.9           ││id:  7┤ 0              ││id: 11┤ 0              │
│      └               ┘││      └               ┘││      └               ┘│
╰───────────────────────╯╰───────────────────────╯╰───────────────────────╯
╭──────────────────────────────────────────────╮
│     ┌                              ┐         │
│Mem: ┤■■■■■■■■■■■■■■■■■■■ 84.985      96.0 GiB│
│     └                              ┘         │
│      Load average: 1.46 1.81 2.09            │
│      Uptime: 13 days, 21:30:29

If the width of your terminal is small (i.e., displaysize(stdout)[1] is small), our package TerminalSystemMonitor.jl
will try adjust the layout graphs displaying CPU usage:

╭───────────────────────╮
│      ┌               ┐│
│id:  0┤■■ 22.2         │
│id:  1┤■■ 19           │
│id:  2┤■ 15            │
│id:  3┤■ 10            │
│      └               ┘│
╰───────────────────────╯
╭───────────────────────╮
│      ┌               ┐│
│id:  4┤ 0              │
│id:  5┤ 0              │
│id:  6┤ 0              │
│id:  7┤ 0              │
│      └               ┘│
╰───────────────────────╯
╭───────────────────────╮
│      ┌               ┐│
│id:  8┤■ 8             │
│id:  9┤ 1              │
│id: 10┤ 1              │
│id: 11┤ 0              │
│      └               ┘│
╰───────────────────────╯
╭────────────────────────────────────────────╮
│     ┌                              ┐       │
│                                            │
│Mem: ┤■■■■■■■■■■■■■■■■■■■ 84.826            │
│96.0 GiB                                    │
│     └                              ┘       │
│                                            │
│      Load average: 1.72 1.8 2.06           │
│      Uptime: 13 days, 21:31:54             │

Monitoring GPU usage

The TerminalSystemMonitor.jl uses Package Extensions feature. See

https://www.youtube.com/watch?v=TiIZlQhFzyk to learn more.

We need to load some auxiliary packages before calling TerminalSystemMonitor.monitor.

NVIDIA GPU

If your computer has several NVIDIA’s GPU, try the following Julia command:

julia> using CUDA; using TerminalSystemMonitor; monitor()

Mac computers with Apple silicon

If your computer is a Apple M-series device, so called computers with Apple silicon, try the following Julia command:

julia> using MacOSIOReport; using TerminalSystemMonitor; monitor()

The MacOSIOReport.jl can be found at GitHub - AtelierArith/MacOSIOReport.jl: Porting macmon project to Julia using ObjectiveC.jl. I ported the vladkens/macmon project to Julia for TerminalSystemMonitor. I hope you like this package.

百聞は一見に如かず(Seeing is believing.) Give it try!

36 Likes

Awesome! Really cool to see a seemless way to monitur both CPU, RAM and GPU all from within a Julia process :heart:

2 Likes