Revert "[WINDOWS] Glances do not display CPU stat correctly #3155"

This reverts commit bb0116a198.
This commit is contained in:
Nicolas Hennion 2025-10-13 11:38:17 +00:00
parent bb0116a198
commit 29e3947577
2 changed files with 2 additions and 8 deletions

View File

@ -202,7 +202,6 @@ class Config:
# CPU
if not self.parser.has_section('cpu'):
self.parser.add_section('cpu')
self.set_default_cwc('cpu', 'total', log=True)
self.set_default_cwc('cpu', 'user')
self.set_default_cwc('cpu', 'system')
self.set_default_cwc('cpu', 'steal')
@ -216,7 +215,6 @@ class Config:
str(iowait_bottleneck - (iowait_bottleneck * 0.10)),
str(iowait_bottleneck),
],
log=True
)
# Context switches bottleneck identification #1212
ctx_switches_bottleneck = (500000 * 0.10) * multiprocessing.cpu_count()
@ -300,7 +298,7 @@ class Config:
"""Return info about the existence of a section."""
return self.parser.has_section(section)
def set_default_cwc(self, section, option_header=None, cwc=['50', '70', '90'], log=False):
def set_default_cwc(self, section, option_header=None, cwc=['50', '70', '90']):
"""Set default values for careful, warning and critical."""
if option_header is None:
header = ''
@ -309,10 +307,6 @@ class Config:
self.set_default(section, header + 'careful', cwc[0])
self.set_default(section, header + 'warning', cwc[1])
self.set_default(section, header + 'critical', cwc[2])
if log:
self.set_default(section, header + 'log', 'True')
else:
self.set_default(section, header + 'log', 'False')
def set_default(self, section, option, default):
"""If the option did not exist, create a default value."""

View File

@ -743,7 +743,7 @@ class GlancesPluginModel:
# Manage log
log_str = ""
if self.get_limit_log(stat_name=stat_name, default_action=log) and ret != 'DEFAULT':
if self.get_limit_log(stat_name=stat_name, default_action=log):
# Add _LOG to the return string
# So stats will be highlighted with a specific color
log_str = "_LOG"