forked from mirror/redis
Remove unneeded synchronization.
This commit is contained in:
parent
d2ae7d8707
commit
d802f0e8bd
13
redis.go
13
redis.go
|
@ -4,7 +4,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"sync/atomic"
|
|
||||||
|
|
||||||
"gopkg.in/redis.v3/internal/pool"
|
"gopkg.in/redis.v3/internal/pool"
|
||||||
)
|
)
|
||||||
|
@ -170,12 +169,12 @@ func NewClient(opt *Options) *Client {
|
||||||
func (c *Client) PoolStats() *PoolStats {
|
func (c *Client) PoolStats() *PoolStats {
|
||||||
s := c.connPool.Stats()
|
s := c.connPool.Stats()
|
||||||
return &PoolStats{
|
return &PoolStats{
|
||||||
Requests: atomic.LoadUint32(&s.Requests),
|
Requests: s.Requests,
|
||||||
Hits: atomic.LoadUint32(&s.Hits),
|
Hits: s.Hits,
|
||||||
Waits: atomic.LoadUint32(&s.Waits),
|
Waits: s.Waits,
|
||||||
Timeouts: atomic.LoadUint32(&s.Timeouts),
|
Timeouts: s.Timeouts,
|
||||||
|
|
||||||
TotalConns: atomic.LoadUint32(&s.TotalConns),
|
TotalConns: s.TotalConns,
|
||||||
FreeConns: atomic.LoadUint32(&s.FreeConns),
|
FreeConns: s.FreeConns,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue