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

Method nbOfKeys

cache/redis_cache.go:66–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64}
65
66func (r *redisCache) nbOfKeys() uint64 {
67 ctx, cancelFunc := context.WithTimeout(context.Background(), statsTimeout)
68 defer cancelFunc()
69 nbOfKeys, err := r.client.DBSize(ctx).Result()
70 if err != nil {
71 log.Errorf("failed to fetch nb of keys in redis: %s", err)
72 }
73 return uint64(nbOfKeys)
74}
75
76func (r *redisCache) nbOfBytes() uint64 {
77 ctx, cancelFunc := context.WithTimeout(context.Background(), statsTimeout)

Callers 2

StatsMethod · 0.95
TestCacheSizeFunction · 0.80

Calls 1

ErrorfFunction · 0.92

Tested by 1

TestCacheSizeFunction · 0.64