Skip to content

Commit

Permalink
add max_depth
Browse files Browse the repository at this point in the history
  • Loading branch information
jslching committed Nov 6, 2023
1 parent 1cb79af commit 9c43091
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions util/ctxutil/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ func NewStack() ContextStack {
c.mutex.Lock()
size := len(c.stacks)
depths := map[int64]int{}
maxDepth := 0
for gid, entry := range c.stacks {
depths[gid] = stackDepth(entry.stack)
depth := stackDepth(entry.stack)
depths[gid] = depth
if depth > maxDepth {
maxDepth = depth
}
}
c.mutex.Unlock()
log.Warn("ContextStack", "size", size, "depths", depths)
log.Warn("ContextStack", "size", size, "max_depth", maxDepth, "depths", depths)
}
}()
return c
Expand Down

0 comments on commit 9c43091

Please sign in to comment.