diff --git a/docs/_static/loadpercent.png b/docs/_static/loadpercent.png new file mode 100644 index 0000000000..7d3e4875c9 Binary files /dev/null and b/docs/_static/loadpercent.png differ diff --git a/docs/aoa/load.rst b/docs/aoa/load.rst index ef1827ab34..08374abbdc 100644 --- a/docs/aoa/load.rst +++ b/docs/aoa/load.rst @@ -25,6 +25,12 @@ Thresholds are computed by dividing the 5 and 15 minutes average load per CPU(s) number. For example, if you have 4 CPUs and the 5 minutes load is 1.0, then the warning threshold will be set to 2.8 (0.7 * 4 * 1.0). +From Glances 3.1.4, if Irix/Solaris mode is off ('0' key), the value is +divided by logical core number and multiple by 100 to have load as a +percentage. + +.. image:: ../_static/loadpercent.png + Legend: ============= ============ diff --git a/docs/aoa/ps.rst b/docs/aoa/ps.rst index d96da721ee..1490614710 100644 --- a/docs/aoa/ps.rst +++ b/docs/aoa/ps.rst @@ -46,8 +46,8 @@ Columns display ========================= ============================================== ``CPU%`` % of CPU used by the process - If Irix/Solaris mode is off, the value is - divided by logical core number + If Irix/Solaris mode is off ('0' key), the value + is divided by logical core number ``MEM%`` % of MEM used by the process (RES divided by the total RAM you have) ``VIRT`` Virtual Memory Size diff --git a/docs/man/glances.1 b/docs/man/glances.1 index efefe0a982..cd9a988275 100644 --- a/docs/man/glances.1 +++ b/docs/man/glances.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GLANCES" "1" "Nov 02, 2019" "3.1.4_BETA" "Glances" +.TH "GLANCES" "1" "Nov 06, 2019" "3.1.4_BETA" "Glances" .SH NAME glances \- An eye on your system . diff --git a/glances/plugins/glances_load.py b/glances/plugins/glances_load.py index 69b0bbfd1b..891a7eb9f1 100644 --- a/glances/plugins/glances_load.py +++ b/glances/plugins/glances_load.py @@ -142,34 +142,29 @@ def msg_curse(self, args=None, max_width=None): # Build the string message # Header - msg = '{:8}'.format('LOAD') + msg = '{:8}'.format('LOAD%' if (args.disable_irix and self.nb_log_core != 0) else 'LOAD') ret.append(self.curse_add_line(msg, "TITLE")) # Core number if 'cpucore' in self.stats and self.stats['cpucore'] > 0: msg = '{}-core'.format(int(self.stats['cpucore'])) ret.append(self.curse_add_line(msg)) - # New line - ret.append(self.curse_new_line()) - # 1min load - msg = '{:8}'.format('1 min:') - ret.append(self.curse_add_line(msg)) - msg = '{:>6.2f}'.format(self.stats['min1']) - ret.append(self.curse_add_line(msg)) - # New line - ret.append(self.curse_new_line()) - # 5min load - msg = '{:8}'.format('5 min:') - ret.append(self.curse_add_line(msg)) - msg = '{:>6.2f}'.format(self.stats['min5']) - ret.append(self.curse_add_line( - msg, self.get_views(key='min5', option='decoration'))) - # New line - ret.append(self.curse_new_line()) - # 15min load - msg = '{:8}'.format('15 min:') - ret.append(self.curse_add_line(msg)) - msg = '{:>6.2f}'.format(self.stats['min15']) - ret.append(self.curse_add_line( - msg, self.get_views(key='min15', option='decoration'))) + # Loop over 1min, 5min and 15min load + for load_time in ['1', '5', '15']: + ret.append(self.curse_new_line()) + msg = '{:8}'.format('{} min:'.format(load_time)) + ret.append(self.curse_add_line(msg)) + if args.disable_irix and self.nb_log_core != 0: + # Enable Irix mode for load (see issue #1554) + load_stat = self.stats['min{}'.format(load_time)] / self.nb_log_core * 100 + else: + load_stat = self.stats['min{}'.format(load_time)] + msg = '{:>6.2f}'.format(load_stat) + if load_time == '1': + ret.append(self.curse_add_line(msg)) + else: + # Alert is only for 5 and 15 min + ret.append(self.curse_add_line( + msg, self.get_views(key='min{}'.format(load_time), + option='decoration'))) return ret