From 9c430919f2fd5d7114d3f24d4009b5aacc51ea4b Mon Sep 17 00:00:00 2001 From: jslching <38669839+jslching@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:47:03 -0500 Subject: [PATCH] add max_depth --- util/ctxutil/stack.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/ctxutil/stack.go b/util/ctxutil/stack.go index 0911569..71458b5 100644 --- a/util/ctxutil/stack.go +++ b/util/ctxutil/stack.go @@ -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