提交 6d1c0ccc 编写于 作者: N nicolargo

Add history to GPU stats. Allowing user to export stats (see #1319)

上级 812db6b7
...@@ -71,7 +71,8 @@ class GlancesExport(object): ...@@ -71,7 +71,8 @@ class GlancesExport(object):
'uptime', 'uptime',
'sensors', 'sensors',
'docker', 'docker',
'uptime'] 'uptime',
'gpu']
def load_conf(self, section, mandatories=['host', 'port'], options=None): def load_conf(self, section, mandatories=['host', 'port'], options=None):
"""Load the export <section> configuration in the Glances configuration file. """Load the export <section> configuration in the Glances configuration file.
......
...@@ -249,8 +249,6 @@ class Plugin(GlancesPlugin): ...@@ -249,8 +249,6 @@ class Plugin(GlancesPlugin):
# Sort and update the stats # Sort and update the stats
self.stats = sort_stats(stats) self.stats = sort_stats(stats)
logger.info('Docker stats (sorted): {}'.format(self.stats))
return self.stats return self.stats
def get_docker_cpu(self, container_id, all_stats): def get_docker_cpu(self, container_id, all_stats):
......
...@@ -32,6 +32,15 @@ except Exception as e: ...@@ -32,6 +32,15 @@ except Exception as e:
else: else:
import_error_tag = False import_error_tag = False
# Define the history items list
# All items in this list will be historised if the --enable-history tag is set
items_history_list = [{'name': 'proc',
'description': 'GPU processor',
'y_unit': '%'},
{'name': 'mem',
'description': 'Memory consumption',
'y_unit': '%'}]
class Plugin(GlancesPlugin): class Plugin(GlancesPlugin):
"""Glances GPU plugin (limited to NVIDIA chipsets). """Glances GPU plugin (limited to NVIDIA chipsets).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册