Skip to content

Commit

Permalink
Fix change temperature graph on overheat
Browse files Browse the repository at this point in the history
+ Improve help menu
+ Add help menu to readme
  • Loading branch information
amanusk committed Aug 9, 2017
1 parent b56ed9d commit 31f21ef
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 32 deletions.
51 changes: 45 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,7 +42,8 @@ or
sudo s-tui
```

## Simplest installation with pip
## Simple installation
### pip (x86 + ARM)
```
sudo pip install s-tui
```
Expand All @@ -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
Expand Down Expand Up @@ -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.

11 changes: 8 additions & 3 deletions s_tui/AboutMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions s_tui/HelpMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion s_tui/HelperFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import subprocess
import re

__version__ = "0.3.8"
__version__ = "0.4.0"
TURBO_MSR = 429

def get_processor_name():
Expand Down
29 changes: 12 additions & 17 deletions s_tui/s_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand All @@ -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"

Expand All @@ -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




Expand Down Expand Up @@ -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)

Expand All @@ -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')
Expand Down Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
packages=['s_tui'],
version=AUX.__version__,
author="Alex Manuskin",
author_email="[email protected]",
description="Terminal UI stress test and monitoring tool",
license="GPLv2",
url="https://github.com/amanusk/s-tui",
Expand Down

0 comments on commit 31f21ef

Please sign in to comment.