Added CSV output back in, fixed bugs in refactoring
This commit is contained in:
parent
b1dc01b101
commit
65c21fb6ce
4 changed files with 120 additions and 33 deletions
|
@ -5,12 +5,16 @@ E2EBreakdownItem = namedtuple("E2EBreakdownItem", ("type", "duration", "location
|
|||
DepTree = namedtuple("DepTree", ("head", "deps"))
|
||||
|
||||
|
||||
def depth(tree: DepTree):
|
||||
return 1 + max(map(depth, tree.deps), default=0)
|
||||
def depth(tree: DepTree, lvl=0):
|
||||
if lvl > 1000:
|
||||
return 0
|
||||
return 1 + max(map(lambda d: depth(d, lvl + 1), tree.deps), default=0)
|
||||
|
||||
|
||||
def size(tree: DepTree):
|
||||
return 1 + sum(map(size, tree.deps))
|
||||
def size(tree: DepTree, lvl=0):
|
||||
if lvl > 1000:
|
||||
return 0
|
||||
return 1 + sum(map(lambda d: size(d, lvl + 1), tree.deps))
|
||||
|
||||
|
||||
def fanout(tree: DepTree):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue