summaryrefslogtreecommitdiff
path: root/internal/flamegraph/trie_insert.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-26 22:26:45 +0300
committerPaul Buetow <paul@buetow.org>2026-05-26 22:26:45 +0300
commitf42d4f4f0b9d3faf38d2f3c3a9753a03440cdd24 (patch)
tree68c19b9a0e4e15ef1704a7ddad3037d5b17ef381 /internal/flamegraph/trie_insert.go
parentd97010869b08079cebb969ceb41fc9bd8823ef67 (diff)
flamegraph: add dual trie value/height totals (task po)
Diffstat (limited to 'internal/flamegraph/trie_insert.go')
-rw-r--r--internal/flamegraph/trie_insert.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/flamegraph/trie_insert.go b/internal/flamegraph/trie_insert.go
index 7748b4a..8c01792 100644
--- a/internal/flamegraph/trie_insert.go
+++ b/internal/flamegraph/trie_insert.go
@@ -1,7 +1,7 @@
package flamegraph
-// insertTriePath follows or creates nodes for frames and adds value at the leaf.
-func insertTriePath(root *trieNode, frames []string, value uint64) {
+// insertTriePath follows or creates nodes for frames and adds values at the leaf.
+func insertTriePath(root *trieNode, frames []string, value, heightValue uint64) {
node := root
for _, frame := range frames {
if node.childMap == nil {
@@ -19,4 +19,5 @@ func insertTriePath(root *trieNode, frames []string, value uint64) {
node = child
}
node.value += value
+ node.heightValue += heightValue
}