The key matrix that determines the viability of a Linux distribution or the hardware on which it runs is system performance. Depending on your purpose, you can choose from a variety of specialized tools to monitor different components, such as CPU frequency, temperature, and memory utilization. However, if you like CLI, just like us, you will prefer to use S-TUI.
Using S-TUI (an acronym for Stress-Terminal UI), you can monitor CPU temperature, frequency, power, and utilization at the same time. The utility displays all information graphically and can even be used to export data as a CSV file. Even better, you can configure S-TUI to automatically start the script when the value of any component being monitored violates a defined threshold. When used in conjunction with stress, another command line utility, S-TUI, can also be used to stress test your system.
Although S-TUI is not available in the software repositories of the most popular desktop distributions, installing the tool is fairly simple, and The project’s GitHub page Various installation techniques are introduced. For our installation, we will use Ubuntu 21.04.
1. In the terminal, Update available software repositories and Install the Python 3 packaging tool.
$ sudo apt update $ sudo apt install python3-pip
2. Install S-TUI Use pip3.
$ sudo pip install s-tui
3. Run S-TUI.
Unlike many other command line utilities, S-TUI does not require configuration, and you can start using it immediately after installation.
At the top of the left sidebar are detailed information about the CPU. Our Lenovo test machine was correctly identified as running Intel Core i3-5005U CPU @ 2.00GHz processor. This is because S-TUI utilizes various other local tools and utilities to gather relevant information. For example, you can determine the same information and more details by running the cat /proc/cpuinfo command.
When S-TUI is started for the first time, it will display all four parameters-frequency, utilization, temperature and power-and refresh the data every two seconds.
To change the refresh rate from two seconds to 0.1, change the value of Refresh[s]: 2.0 to 0.1. Note that this will put extra pressure on your Pi.
Use the up and down arrow keys to navigate the sidebar, but S-TUI also supports H and J to scroll, just like in Vim. S-TUI is also suitable for mouse input.
Use S-TUI to stress test your machine
By default, S-TUI is configured to monitor only your system. In order to push our machine to the limit, we installed the “stress” stress test terminal tool. Stress is applicable to all types of CPUs. We use it to stress test Raspberry Pis as part of the stressberry Python benchmark tool.
1. To install pressure, open the terminal And enter the following.
$ sudo apt install stress
2. Open S-TUI.
3. Using the arrow keys, navigate to Stress and press the space bar. Alternatively, you can also use the mouse to make a selection. You will see the CPU graph update quickly, showing the current processor temperature, frequency, and utilization. The stress test will run indefinitely.
4. Turn off the stress test By navigating to the monitor and pressing the space bar, or by clicking the mouse.
5. Set up a time-limited stress test, Navigation/click pressure options and Change the timeout to the time (in seconds) you want. Set the number of Sqrt() worker threads to match the number of cores of the CPU. Click Save when finished.
6. Click/navigate to Stress and press the space bar Run timed tests. Here, we set the duration to 30 seconds and leave the number of workers as 4.
Save your test results
Once you exit S-TUI, the collected data will be lost because the tool does not save it by default.
To automatically save the collected information to a time-stamped CSV file when you exit S-TUI, call the command as follows.
$ s-tui -c
To specify your own file name, use the “–csv-file” invocation command to provide the file name.
$ s-tui --csv-file <name of file>.csv
If you prefer data in JSON format, we can output data in JSON format, but only the current status, not the running log.
$ s-tui -j