MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / Stats

Method Stats

cache/redis_cache.go:59–64  ·  view source on GitHub ↗

Stats will make two calls to redis. First one fetches the number of keys stored in redis (DBSize) Second one will fetch memory info that will be parsed to fetch the used_memory NOTE : we can only fetch database size, not cache size

()

Source from the content-addressed store, hash-verified

57// Second one will fetch memory info that will be parsed to fetch the used_memory
58// NOTE : we can only fetch database size, not cache size
59func (r *redisCache) Stats() Stats {
60 return Stats{
61 Items: r.nbOfKeys(),
62 Size: r.nbOfBytes(),
63 }
64}
65
66func (r *redisCache) nbOfKeys() uint64 {
67 ctx, cancelFunc := context.WithTimeout(context.Background(), statsTimeout)

Callers

nothing calls this directly

Calls 2

nbOfKeysMethod · 0.95
nbOfBytesMethod · 0.95

Tested by

no test coverage detected