MCPcopy Create free account
hub / github.com/adny-code/fastgrind / _annotate_stack_tree_share

Method _annotate_stack_tree_share

tools/fastgrind.py:1410–1415  ·  view source on GitHub ↗
(self, node: dict[str, Any], total_value: float)

Source from the content-addressed store, hash-verified

1408 return tree
1409
1410 def _annotate_stack_tree_share(self, node: dict[str, Any], total_value: float) -> None:
1411 current_value = float(node.get("value", 0.0))
1412 share_percent = 0.0 if abs(total_value) < 1e-12 else (current_value / total_value) * 100.0
1413 node["share_percent"] = share_percent
1414 for child in node.get("children", []):
1415 self._annotate_stack_tree_share(child, total_value)
1416
1417 def _stack_tree_to_text(self, tree: dict[str, Any]) -> str:
1418 lines = [f"{_stack_node_name(tree)} {_format_stack_summary(tree)}"]

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected