From 8237e8d09e9561858c87e135df415b920b5d866d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 08:51:06 +0000 Subject: [chore]: Bump codeberg.org/gruf/go-structr from 0.7.0 to 0.8.0 (#2902) Bumps codeberg.org/gruf/go-structr from 0.7.0 to 0.8.0. --- updated-dependencies: - dependency-name: codeberg.org/gruf/go-structr dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor/codeberg.org/gruf/go-structr/cache.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'vendor/codeberg.org/gruf/go-structr/cache.go') diff --git a/vendor/codeberg.org/gruf/go-structr/cache.go b/vendor/codeberg.org/gruf/go-structr/cache.go index 1a2a07257..d9bcc58d3 100644 --- a/vendor/codeberg.org/gruf/go-structr/cache.go +++ b/vendor/codeberg.org/gruf/go-structr/cache.go @@ -527,6 +527,24 @@ func (c *Cache[T]) Len() int { return l } +// Debug returns debug stats about cache. +func (c *Cache[T]) Debug() map[string]any { + m := make(map[string]any) + c.mutex.Lock() + m["lru"] = c.lru.len + indices := make(map[string]any) + m["indices"] = indices + for i := range c.indices { + var n uint64 + for _, list := range c.indices[i].data { + n += uint64(list.len) + } + indices[c.indices[i].name] = n + } + c.mutex.Unlock() + return m +} + // Cap returns the maximum capacity (size) of cache. func (c *Cache[T]) Cap() int { c.mutex.Lock() -- cgit v1.2.3