mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 18:12:25 -05:00
[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:
parent
a5f28fe0c9
commit
8237e8d09e
6 changed files with 58 additions and 4 deletions
18
vendor/codeberg.org/gruf/go-structr/cache.go
generated
vendored
18
vendor/codeberg.org/gruf/go-structr/cache.go
generated
vendored
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue