* In hoststats subcommand: Also print node status flags if they exist.
This commit is contained in:
@@ -215,6 +215,7 @@ def collect_host_stats(qstat_f, show_disabled_nodes=None):
|
|||||||
hoststat['queues'].append(queue)
|
hoststat['queues'].append(queue)
|
||||||
# FIXME we assume all have same load; fix if not correct:
|
# FIXME we assume all have same load; fix if not correct:
|
||||||
hoststat['node_load'] = node_load
|
hoststat['node_load'] = node_load
|
||||||
|
hoststat['status_flags'] = status_flags
|
||||||
|
|
||||||
#return host_list_by_kinds, host_stats
|
#return host_list_by_kinds, host_stats
|
||||||
return host_stats
|
return host_stats
|
||||||
@@ -237,7 +238,7 @@ def print_host_stats(host_stats):
|
|||||||
% ("HOST", "CORES", "used", "free", "resv", "load", "load/used"))
|
% ("HOST", "CORES", "used", "free", "resv", "load", "load/used"))
|
||||||
for h in hostnames:
|
for h in hostnames:
|
||||||
hs = host_stats[h]
|
hs = host_stats[h]
|
||||||
print("%-16s %5d %5d %5d %5d %7.2f %9.3f" \
|
print("%-16s %5d %5d %5d %5d %7.2f %9.3f%s" \
|
||||||
% (h,
|
% (h,
|
||||||
hs['slots_tot'],
|
hs['slots_tot'],
|
||||||
hs['slots_used'],
|
hs['slots_used'],
|
||||||
@@ -245,6 +246,7 @@ def print_host_stats(host_stats):
|
|||||||
hs['slots_resv'],
|
hs['slots_resv'],
|
||||||
hs['node_load'],
|
hs['node_load'],
|
||||||
node_load_ratio(hs['node_load'], hs['slots_used']),
|
node_load_ratio(hs['node_load'], hs['slots_used']),
|
||||||
|
" "+hs['status_flags'] if hs['status_flags'] else ""
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -313,6 +315,9 @@ Usage: one of the following:
|
|||||||
%(CMD)s raw [qstat_file] [--save] [--show-disabled-nodes]
|
%(CMD)s raw [qstat_file] [--save] [--show-disabled-nodes]
|
||||||
Shows the raw queue/node status
|
Shows the raw queue/node status
|
||||||
|
|
||||||
|
%(CMD)s hoststats [qstat_file] [--save] [--show-disabled-nodes]
|
||||||
|
Shows the present statistics for every node
|
||||||
|
|
||||||
%(CMD)s
|
%(CMD)s
|
||||||
%(CMD)s stats [qstat_file] [--save] [--show-disabled-nodes]
|
%(CMD)s stats [qstat_file] [--save] [--show-disabled-nodes]
|
||||||
Shows the statistic summary per node type
|
Shows the statistic summary per node type
|
||||||
|
|||||||
Reference in New Issue
Block a user