MCPcopy
hub / github.com/redis/go-redis / PoolStats

Method PoolStats

ring.go:656–669  ·  view source on GitHub ↗

PoolStats returns accumulated connection pool stats.

()

Source from the content-addressed store, hash-verified

654
655// PoolStats returns accumulated connection pool stats.
656func (c *Ring) PoolStats() *PoolStats {
657 // note: `c.List()` return a shadow copy of `[]*ringShard`.
658 shards := c.sharding.List()
659 var acc PoolStats
660 for _, shard := range shards {
661 s := shard.Client.connPool.Stats()
662 acc.Hits += s.Hits
663 acc.Misses += s.Misses
664 acc.Timeouts += s.Timeouts
665 acc.TotalConns += s.TotalConns
666 acc.IdleConns += s.IdleConns
667 }
668 return &acc
669}
670
671// Len returns the current number of shards in the ring.
672func (c *Ring) Len() int {

Callers

nothing calls this directly

Calls 2

ListMethod · 0.80
StatsMethod · 0.65

Tested by

no test coverage detected