[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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot]
2024-05-06 08:51:06 +00:00
committed by GitHub
parent a5f28fe0c9
commit 8237e8d09e
6 changed files with 58 additions and 4 deletions

View File

@ -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()