This commit is contained in:
Costa Shulyupin 2018-09-16 15:41:21 +03:00
parent 14943fc591
commit f90b1b84fe
1 changed files with 5 additions and 3 deletions

View File

@ -808,7 +808,7 @@ def stats(a):
im = dict() im = dict()
om = dict() om = dict()
leaves = set() leaves = set()
roots = set() roots = dict()
stat.edge_nodes = 0 stat.edge_nodes = 0
stat.couples = 0 stat.couples = 0
for n in dg: for n in dg:
@ -819,7 +819,7 @@ def stats(a):
if id: if id:
im[n] = id im[n] = id
else: else:
roots.add(n) roots[n] = od
if od: if od:
om[n] = od om[n] = od
else: else:
@ -830,13 +830,14 @@ def stats(a):
stat.max_out_degree = max(dict(dg.out_degree).values()) stat.max_out_degree = max(dict(dg.out_degree).values())
stat.leaves = len(leaves) stat.leaves = len(leaves)
stat.roots = len(roots) stat.roots = len(roots)
stat.big_roots = ' '.join(sort_dict(roots)[:20])
# pprint(im) # pprint(im)
# pprint(om) # pprint(om)
stat._popular = ' '.join(sort_dict(im)[:10]) stat._popular = ' '.join(sort_dict(im)[:10])
stat._biggest = ' '.join(sort_dict(om)[:10]) stat._biggest = ' '.join(sort_dict(om)[:10])
gd = remove_loops(dg) gd = remove_loops(dg)
stat.dag_longest_path_len = len(dag_longest_path(dg)) stat.dag_longest_path_len = len(dag_longest_path(dg))
print(' '.join(dag_longest_path(dg))) stat.__longest_path = ' '.join(dag_longest_path(dg)[:10] + [''])
for a in [nx.DiGraph.number_of_nodes, nx.DiGraph.number_of_edges, nx.DiGraph.number_of_selfloops, for a in [nx.DiGraph.number_of_nodes, nx.DiGraph.number_of_edges, nx.DiGraph.number_of_selfloops,
nx.DiGraph.order]: nx.DiGraph.order]:
stat[a.__name__] = a(dg) stat[a.__name__] = a(dg)
@ -897,6 +898,7 @@ def usage():
print(me, "referers_tree nfs_root_data") print(me, "referers_tree nfs_root_data")
print(me, "call_tree start_kernel") print(me, "call_tree start_kernel")
print(me, "import_cflow $none_or_dir_or_file_or_mask") print(me, "import_cflow $none_or_dir_or_file_or_mask")
print(me, "stats $dot")
print("Emergency termination: ^Z, kill %1") print("Emergency termination: ^Z, kill %1")
print() print()