From 31f21ef90f2b34fa214e66d72829978d6a7914ae Mon Sep 17 00:00:00 2001 From: amanusk Date: Wed, 9 Aug 2017 15:31:43 +0300 Subject: [PATCH] Fix change temperature graph on overheat + Improve help menu + Add help menu to readme --- README.md | 51 +++++++++++++++++++++++++++++++++++----- s_tui/AboutMenu.py | 11 ++++++--- s_tui/HelpMenu.py | 9 +++---- s_tui/HelperFunctions.py | 2 +- s_tui/s_tui.py | 29 ++++++++++------------- setup.py | 1 - 6 files changed, 71 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index e94ad33..ba288d8 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,28 @@ s-tui is a terminal UI for monitoring your computer. s-tui allows to monitor CPU ## Screenshot ![](https://thumbs.gfycat.com/SaneBadFlea-size_restricted.gif) -### Pros -* Monitoring your headless server over ssh -* See performance dips caused by thermal throttling +* [The Stress Terminal UI: s-tui](#the-stress-terminal-ui-s-tui) + * [Screenshot](#screenshot) + * [What it does](#what-it-does) + * [Usage](#usage) + * [Simple installation](#simple-installation) + * [pip (x86 ARM)](#pip-x86--arm) + * [Run local executable (x86 only):](#run-local-executable-x86-only) + * [Options](#options) + * [Dependencies](#dependencies) + * [Other installation methods](#other-installation-methods) + * [Ubuntu](#ubuntu) + * [Arch-Linux](#arch-linux) + * [Build](#build) + * [Compatibility](#compatibility) + + +## What it does +* Monitoring your CPU temperature/utilization/frequency +* Shows performance dips caused by thermal throttling * Requires minimal resources +* Requires no X-server +* Built in options for stressing the CPU (stress/stress-ng) ## Usage @@ -24,7 +42,8 @@ or sudo s-tui ``` -## Simplest installation with pip +## Simple installation +### pip (x86 + ARM) ``` sudo pip install s-tui ``` @@ -33,12 +52,30 @@ Or if you cannot use sudo: pip install s-tui --user ``` -## Run local executable: +If you are installing s-tui on a Raspberry-Pi you might need to install `python-dev` first + +### Run local executable (x86 only): * Download the latest release version from https://github.com/amanusk/s-tui/releases * Change s-tui to executable `chmod +x s-tui` * Run `(sudo) ./s-tui` +## Options +``` +********s-tui manual******** +Usage in graphical mode: +* Toggle between stressed and regular operation using the radio buttons. +* If you wish to alternate stress defaults, you can do it in 'stress options' +* If your system supports it, you can use the utf8 button to get a smoother graph +* Reset buttons resets the graph and the max statistics +optional arguments: + -h, --help show this help message and exit + -d, --debug Output debug log to _s-tui.log + -c, --csv Save stats to csv file + -t, --terminal Display a single line of stats without tui + -j, --json Display a single line of stats in JSON format + -v, --version Display version +``` ## Dependencies s-tui is a great tool for monitoring. If you would like to stress your computer, install stress. Stress options will then show up in s-tui @@ -87,5 +124,7 @@ s-tui uses psutil to probe your hardware information. If your hardware is not su Running s-tui as root gives access to the maximum Turbo Boost frequency available to your CPU when stressing all cores. (Currently tested on Intel only). Running without root will display the Turbo Boost available on a single core. -* s-tui tested to run on Raspberry-pi 3 +* s-tui tested to run on Raspberry-Pi 3 + +* If the temperature does not show up, your sensor might not be supported. Try opening an issue on github and we can look into it. diff --git a/s_tui/AboutMenu.py b/s_tui/AboutMenu.py index 54235a5..a04e651 100644 --- a/s_tui/AboutMenu.py +++ b/s_tui/AboutMenu.py @@ -26,11 +26,16 @@ About:\n\ s-tui is a monitoring tool for your CPU temperature, frequency and utilization. s-tui makes it possilble to monitor your computer over SSH without a need for a GUI\n\ \n\ -Authors:\n\ -Alex Manuskin, Gil Tsuker\n\ -\n\ Code for s-tui is available on github\n\ https://github.com/amanusk/s-tui\n\ +\n\ +*** Please star on github :) ***\n\ +\n\ +Created by:\n\ + - Alex Manuskin\n\ + - Gil Tsuker\n\ +\n\ +April 2017\n\ " MESSAGE_LEN = 20 diff --git a/s_tui/HelpMenu.py b/s_tui/HelpMenu.py index 67f830d..97ec621 100644 --- a/s_tui/HelpMenu.py +++ b/s_tui/HelpMenu.py @@ -22,14 +22,15 @@ from __future__ import print_function import urwid -HELP_MESSAGE = " \n\ -Usage:\n\ +HELP_MESSAGE = """ +********s-tui manual******** +Usage in graphical mode:\n\ * Toggle between stressed and regular operation using the radio buttons.\n\ * If you wish to alternate stress defaults, you can do it in 'stress options\n\ * If your system supports it, you can use the utf8 button to get a smoother graph\n\ * Reset buttons resets the graph and the max statistics\n\ -* Use the quit button to quit the software\n\ -" +\n\ +""" MESSAGE_LEN = 20 diff --git a/s_tui/HelperFunctions.py b/s_tui/HelperFunctions.py index d409180..699cea4 100644 --- a/s_tui/HelperFunctions.py +++ b/s_tui/HelperFunctions.py @@ -26,7 +26,7 @@ import subprocess import re -__version__ = "0.3.8" +__version__ = "0.4.0" TURBO_MSR = 429 def get_processor_name(): diff --git a/s_tui/s_tui.py b/s_tui/s_tui.py index 1d858b4..3931deb 100755 --- a/s_tui/s_tui.py +++ b/s_tui/s_tui.py @@ -37,6 +37,7 @@ from ComplexBarGraphs import ScalableBarGraph from GraphData import GraphData from HelpMenu import HelpMenu +from HelpMenu import HELP_MESSAGE from StressMenu import StressMenu from HelperFunctions import PALETTE from HelperFunctions import __version__ @@ -52,9 +53,10 @@ DEFAULT_CSV_FILE = "stui_log_" + time.strftime("%Y-%m-%d_%H_%M_%S") + ".csv" -VERSION_MESSAGE = " s-tui " + __version__ +\ - " - (C) 2017 Alex Manuskin, Gil Tsuker\n\ - Released under GNU GPLv2" +VERSION_MESSAGE = \ +"s-tui " + __version__ +\ +" - (C) 2017 Alex Manuskin, Gil Tsuker\n\ +Released under GNU GPLv2" fire_starter = "FIRESTARTER/FIRESTARTER" @@ -64,17 +66,8 @@ graph_controller = None stress_program = None -INTRO_MESSAGE = "\ -********s-tui manual********\n\ --Alex Manuskin \n\ --Gil Tsuker \n\ -April 2017\n\ -\n\ -s-tui is a terminal UI add-on for stress. The software uses stress to run CPU \ -hogs, while monitoring the CPU usage, temperature and frequency.\n\ -The software was conceived with the vision of being able to stress test your \ -computer without the need for a GUI\n\ -" +INTRO_MESSAGE = HELP_MESSAGE + @@ -246,6 +239,7 @@ def update_displayed_graph_data(graph_data, data_max, graph): self.data.MAX_UTIL, self.graph_util) # Updating CPU temperature graph + self.set_temp_color() update_displayed_graph_data(self.data.cpu_temp, self.data.MAX_TEMP, self.graph_temp) @@ -259,6 +253,7 @@ def update_displayed_graph_data(graph_data, data_max, graph): def set_temp_color(self, smooth=None): """Paint graph red in overheat is detected""" if self.data.overheat: + logging.info("Overheat detected ") new_color = (['bg background', 'high temp dark', 'high temp light'], {(1, 0): 'high temp dark smooth', (2, 0): 'high temp light smooth'}, 'high temp txt') @@ -734,13 +729,13 @@ def get_args(): formatter_class=argparse.RawTextHelpFormatter) parser.add_argument('-d', '--debug', - default=False, action='store_true', help="Output debug log to " + log_file) + default=False, action='store_true', help="Output debug log to _s-tui.log") parser.add_argument('-c', '--csv', action='store_true', default=False, help="Save stats to csv file") - parser.add_argument('-j', '--json', action='store_true', - default=False, help="Display a single line in JSON format") parser.add_argument('-t', '--terminal', action='store_true', default=False, help="Display a single line of stats without tui") + parser.add_argument('-j', '--json', action='store_true', + default=False, help="Display a single line of stats in JSON format") parser.add_argument('-v', '--version', default=False, action='store_true', help="Display version") args = parser.parse_args() diff --git a/setup.py b/setup.py index dd798b0..8fa785b 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,6 @@ packages=['s_tui'], version=AUX.__version__, author="Alex Manuskin", - author_email="alex.manuskin@gmail.com", description="Terminal UI stress test and monitoring tool", license="GPLv2", url="https://github.com/amanusk/s-tui",