/coremon3

Very basic CPU monitor implemented using fltk

Primary LanguageC++MIT LicenseMIT

coremon3: very simple CPU core monitor

This program is an incredibly simple Linux CPU core monitor program. Its intended purpose is to monitor CPU core activity by reading /proc/stat at regular intervals (currently hard-coded at 4 times per second) and then drawing a bar graph showing user and system time for each core.

It's implemented using fltk. On Ubuntu 24.04 and similar, you can install it using the command

sudo apt install libfltk1.3-dev

To build coremon3:

make depend
make

The executable is build/coremon3.

Here's a screen capture (14 seconds) showing activity on my 6 core/12 thread CPU as I run make depend followed by make -j on a medium-size C++ project:

screen capture video

Invoking

The program supports all of the standard command line arguments processed by Fl_Window::show, including -geometry to set the windows initial size and position.

The following coremon3-specific command line arguments are supported:

  • --always-on-top: the coremon3 window has the "always on top" window manager flag set, so it's always shown above other windows
  • --no-border: don't show Window manager decorations: note that this means that there will be no task bar entry for coremon3

To make the bar graph fill the width of the window, the window width should be an integer multiple of the number of CPU cores. On my six-core, twelve-thread Ryzen 5 5600X, I invoke coremon3 as

$SOME_PATH/coremon3 --always-on-top --no-border -geometry 120x60-200+0

which positions the window near the upper-right of the display.

Moving the window

You can use the left mouse button to drag the window in order to move it. This is helpful if you've used the --no-border command line argument, meaning that the window manager window bar isn't shown.

Quitting

Typing "q" or "Q" while the mouse pointer is inside the coremon3 window will exit the program.

License

coremon3 is distributed under the terms of the MIT License.