コード例 #1
0
def sort_stats(stats):
    # Sort Docker stats using the same function than processes
    sortedby = 'cpu_percent'
    sortedby_secondary = 'memory_usage'
    if glances_processes.sort_key.startswith('memory'):
        sortedby = 'memory_usage'
        sortedby_secondary = 'cpu_percent'
    sort_stats_processes(stats['containers'],
                         sortedby=sortedby,
                         sortedby_secondary=sortedby_secondary)
    return stats
コード例 #2
0
ファイル: glances_docker.py プロジェクト: nicolargo/glances
def sort_stats(stats):
    # Sort Docker stats using the same function than processes
    sortedby = 'cpu_percent'
    sortedby_secondary = 'memory_usage'
    if glances_processes.sort_key.startswith('memory'):
        sortedby = 'memory_usage'
        sortedby_secondary = 'cpu_percent'
    sort_stats_processes(stats['containers'],
                         sortedby=sortedby,
                         sortedby_secondary=sortedby_secondary)
    return stats