Skip to content

Commit

Permalink
feat: refactor processing time tree sum method to summarize_tree
Browse files Browse the repository at this point in the history
Signed-off-by: Taekjin LEE <[email protected]>
  • Loading branch information
technolojin committed Aug 8, 2024
1 parent ca485fb commit ace537e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def callback(self, msg: ProcessingTimeTreeMsg):
if tree.name not in self.total_tree:
self.total_tree[tree.name] = tree
else:
self.total_tree[tree.name].sum(tree)
self.total_tree[tree.name].summarize_tree(tree)


def main(args=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ def construct_string(
# sum up the processing tree time
# if the incoming tree has new nodes, add them to the current tree
# count the number of times the tree has been updated
def sum(self, other: "ProcessingTimeTree") -> None:
def summarize_tree(self, other: "ProcessingTimeTree") -> None:
self.processing_time += other.processing_time
self.run_count += other.run_count

for other_child in other.children:
found = False
for child in self.children:
if child == other_child:
child.sum(other_child)
child.summarize_tree(other_child)
found = True
break
if not found:
Expand Down

0 comments on commit ace537e

Please sign in to comment.