diff --git a/docs/_static/glances-summary.png b/docs/_static/glances-summary.png index 0d4b9ef4..02160837 100644 Binary files a/docs/_static/glances-summary.png and b/docs/_static/glances-summary.png differ diff --git a/glances/plugins/core/__init__.py b/glances/plugins/core/__init__.py index c4a8816b..2925a7d5 100644 --- a/glances/plugins/core/__init__.py +++ b/glances/plugins/core/__init__.py @@ -17,7 +17,7 @@ import psutil fields_description = { 'phys': {'description': 'Number of physical cores (hyper thread CPUs are excluded).', 'unit': 'number'}, 'log': { - 'description': 'Number of logical CPUs. A logical CPU is the number of \ + 'description': 'Number of logical CPU cores. A logical CPU is the number of \ physical cores multiplied by the number of threads that can run on each core.', 'unit': 'number', }, diff --git a/glances/plugins/load/__init__.py b/glances/plugins/load/__init__.py index 0191321f..7375505f 100644 --- a/glances/plugins/load/__init__.py +++ b/glances/plugins/load/__init__.py @@ -60,12 +60,17 @@ items_history_list = [ # Get the number of logical CPU core only once # the variable is also shared with the QuickLook plugin +nb_log_core = 1 +nb_phys_core = 1 try: - nb_log_core = CorePluginModel().update()["log"] + core = CorePluginModel().update() except Exception as e: logger.warning('Error: Can not retrieve the CPU core number (set it to 1) ({})'.format(e)) - nb_log_core = 1 - +else: + if 'log' in core: + nb_log_core = core['log'] + if 'phys' in core: + nb_phys_core = core['phys'] class PluginModel(GlancesPluginModel): """Glances load plugin. @@ -183,6 +188,11 @@ def get_nb_log_core(): return nb_log_core +def get_nb_phys_core(): + """Get the number of physical CPU core.""" + return nb_phys_core + + def get_load_average(percent: bool = False): """Get load average. On both Linux and Windows thanks to PsUtil diff --git a/glances/plugins/quicklook/__init__.py b/glances/plugins/quicklook/__init__.py index 2d0e8e70..0ab25c32 100644 --- a/glances/plugins/quicklook/__init__.py +++ b/glances/plugins/quicklook/__init__.py @@ -11,7 +11,7 @@ from glances.logger import logger from glances.cpu_percent import cpu_percent -from glances.plugins.load import get_load_average, get_nb_log_core +from glances.plugins.load import get_load_average, get_nb_log_core, get_nb_phys_core from glances.outputs.glances_bars import Bar from glances.outputs.glances_sparklines import Sparkline from glances.plugins.plugin.model import GlancesPluginModel @@ -41,6 +41,14 @@ fields_description = { 'description': 'LOAD percent usage', 'unit': 'percent', }, + 'cpu_log_core': { + 'description': 'Number of logical CPU core', + 'unit': 'number', + }, + 'cpu_phys_core': { + 'description': 'Number of physical CPU core', + 'unit': 'number', + }, 'cpu_name': { 'description': 'CPU name', }, @@ -121,7 +129,8 @@ class PluginModel(GlancesPluginModel): stats['swap'] = None # Get load - stats['cpucore'] = get_nb_log_core() + stats['cpu_log_core'] = get_nb_log_core() + stats['cpu_phys_core'] = get_nb_phys_core() try: # Load average is a tuple (1 min, 5 min, 15 min) # Process only the 15 min value (index 2)