mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-25 10:12:55 +03:00
CSV export dependent on sort order for docker container cpu #2156
This commit is contained in:
parent
c53afdc8bf
commit
1cad8df2da
@ -81,10 +81,10 @@ class Export(GlancesExport):
|
||||
# Loop over plugins to export
|
||||
for plugin in self.plugins_to_export(stats):
|
||||
if isinstance(all_stats[plugin], list):
|
||||
for stat in all_stats[plugin]:
|
||||
for stat in sorted(all_stats[plugin], key=lambda x: x['key']):
|
||||
# First line: header
|
||||
if self.first_line:
|
||||
csv_header += ('{}_{}_{}'.format(plugin, self.get_item_key(stat), item) for item in stat)
|
||||
csv_header += ['{}_{}_{}'.format(plugin, self.get_item_key(stat), item) for item in stat]
|
||||
# Others lines: stats
|
||||
csv_data += itervalues(stat)
|
||||
elif isinstance(all_stats[plugin], dict):
|
||||
|
@ -118,7 +118,7 @@ class GlancesStats(object):
|
||||
if args is not None:
|
||||
# If the all key is set in the disable_plugin option then look in the enable_plugin option
|
||||
if getattr(args, 'disable_all', False):
|
||||
logger.info('%s => %s', name, getattr(args, 'enable_' + name, False))
|
||||
logger.debug('%s => %s', name, getattr(args, 'enable_' + name, False))
|
||||
setattr(args, 'disable_' + name, not getattr(args, 'enable_' + name, False))
|
||||
else:
|
||||
setattr(args, 'disable_' + name, getattr(args, 'disable_' + name, False))
|
||||
|
Loading…
Reference in New Issue
Block a user