本文整理汇总了Python中glances.plugins.glances_plugin.GlancesPlugin.update_views方法的典型用法代码示例。如果您正苦于以下问题:Python GlancesPlugin.update_views方法的具体用法?Python GlancesPlugin.update_views怎么用?Python GlancesPlugin.update_views使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类glances.plugins.glances_plugin.GlancesPlugin
的用法示例。
在下文中一共展示了GlancesPlugin.update_views方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_views
# 需要导入模块: from glances.plugins.glances_plugin import GlancesPlugin [as 别名]
# 或者: from glances.plugins.glances_plugin.GlancesPlugin import update_views [as 别名]
def update_views(self):
"""Update stats views."""
# Call the father's method
GlancesPlugin.update_views(self)
# Add specifics informations
# Alert and log
self.views['used']['decoration'] = self.get_alert_log(self.stats['used'], maximum=self.stats['total'])
示例2: update_views
# 需要导入模块: from glances.plugins.glances_plugin import GlancesPlugin [as 别名]
# 或者: from glances.plugins.glances_plugin.GlancesPlugin import update_views [as 别名]
def update_views(self):
"""Update stats views."""
# Call the father's method
GlancesPlugin.update_views(self)
# Add specifics informations
# Optional
for key in self.stats.keys():
self.views[key]['optional'] = True
示例3: update_views
# 需要导入模块: from glances.plugins.glances_plugin import GlancesPlugin [as 别名]
# 或者: from glances.plugins.glances_plugin.GlancesPlugin import update_views [as 别名]
def update_views(self):
"""Update stats views."""
# Call the father's method
GlancesPlugin.update_views(self)
# Add specifics informations
# Alert
for i in self.stats:
self.views[i[self.get_key()]]['used']['decoration'] = self.get_alert(
i['used'], maximum=i['size'], header=i['mnt_point'])
示例4: update_views
# 需要导入模块: from glances.plugins.glances_plugin import GlancesPlugin [as 别名]
# 或者: from glances.plugins.glances_plugin.GlancesPlugin import update_views [as 别名]
def update_views(self):
"""Update stats views."""
# Call the father's method
GlancesPlugin.update_views(self)
# Add specifics informations
# Alert only
for key in ['cpu', 'mem', 'swap']:
if key in self.stats:
self.views[key]['decoration'] = self.get_alert(self.stats[key], header=key)
示例5: update_views
# 需要导入模块: from glances.plugins.glances_plugin import GlancesPlugin [as 别名]
# 或者: from glances.plugins.glances_plugin.GlancesPlugin import update_views [as 别名]
def update_views(self):
"""Update stats views."""
# Call the father's method
GlancesPlugin.update_views(self)
# Add specifics informations
# Alert and log
self.views['used']['decoration'] = self.get_alert_log(self.stats['used'], maximum=self.stats['total'])
# Optional
for key in ['active', 'inactive', 'buffers', 'cached']:
if key in self.stats:
self.views[key]['optional'] = True
示例6: update_views
# 需要导入模块: from glances.plugins.glances_plugin import GlancesPlugin [as 别名]
# 或者: from glances.plugins.glances_plugin.GlancesPlugin import update_views [as 别名]
def update_views(self):
"""Update stats views."""
# Call the father's method
GlancesPlugin.update_views(self)
# Add specifics informations
# Alert
for i in self.stats:
disk_real_name = i['disk_name']
self.views[i[self.get_key()]]['read_bytes']['decoration'] = self.get_alert(int(i['read_bytes'] // i['time_since_update']),
header=disk_real_name + '_rx')
self.views[i[self.get_key()]]['write_bytes']['decoration'] = self.get_alert(int(i['write_bytes'] // i['time_since_update']),
header=disk_real_name + '_tx')
示例7: update_views
# 需要导入模块: from glances.plugins.glances_plugin import GlancesPlugin [as 别名]
# 或者: from glances.plugins.glances_plugin.GlancesPlugin import update_views [as 别名]
def update_views(self):
"""Update stats views"""
# Call the father's method
GlancesPlugin.update_views(self)
# Add specifics informations
# Alert
for i in self.stats:
ifrealname = i['interface_name'].split(':')[0]
self.views[i[self.get_key()]]['rx']['decoration'] = self.get_alert(int(i['rx'] // i['time_since_update'] * 8),
header=ifrealname + '_rx')
self.views[i[self.get_key()]]['tx']['decoration'] = self.get_alert(int(i['tx'] // i['time_since_update'] * 8),
header=ifrealname + '_tx')
示例8: update_views
# 需要导入模块: from glances.plugins.glances_plugin import GlancesPlugin [as 别名]
# 或者: from glances.plugins.glances_plugin.GlancesPlugin import update_views [as 别名]
def update_views(self):
"""Update stats views."""
# Call the father's method
GlancesPlugin.update_views(self)
# Add specifics informations
# Alert
for i in self.stats:
if not i['value']:
continue
if i['type'] == 'battery':
self.views[i[self.get_key()]]['value']['decoration'] = self.get_alert(100 - i['value'], header=i['type'])
else:
self.views[i[self.get_key()]]['value']['decoration'] = self.get_alert(i['value'], header=i['type'])
示例9: update_views
# 需要导入模块: from glances.plugins.glances_plugin import GlancesPlugin [as 别名]
# 或者: from glances.plugins.glances_plugin.GlancesPlugin import update_views [as 别名]
def update_views(self):
"""Update stats views"""
# Call the father's method
GlancesPlugin.update_views(self)
# Add specifics informations
try:
# Alert and log
self.views['min15']['decoration'] = self.get_alert_log(self.stats['min15'], max=100 * self.stats['cpucore'])
# Alert only
self.views['min5']['decoration'] = self.get_alert(self.stats['min5'], max=100 * self.stats['cpucore'])
except KeyError:
# try/except mandatory for Windows compatibility (no load stats)
pass
示例10: update_views
# 需要导入模块: from glances.plugins.glances_plugin import GlancesPlugin [as 别名]
# 或者: from glances.plugins.glances_plugin.GlancesPlugin import update_views [as 别名]
def update_views(self):
"""Update stats views."""
# Call the father's method
GlancesPlugin.update_views(self)
# Add specifics informations
# Alert and log
for key in ['user', 'system', 'iowait']:
if key in self.stats:
self.views[key]['decoration'] = self.get_alert_log(self.stats[key], header=key)
# Alert only
for key in ['steal', 'total']:
if key in self.stats:
self.views[key]['decoration'] = self.get_alert(self.stats[key], header=key)
# Optional
for key in ['nice', 'irq', 'iowait', 'steal']:
if key in self.stats:
self.views[key]['optional'] = True