Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterMetrics(r metrics.Registerer, version, server string, stater PoolStater)
- type Cluster
- type ConnectionOptions
- type Option
- func WithDialConnectTimeout(timeout time.Duration) Option
- func WithDialPassword(password string) Option
- func WithLogger(logger *zap.Logger) Option
- func WithMetrics(r metrics.Registerer) Option
- func WithPoolIdleTimeout(timeout time.Duration) Option
- func WithPoolMaxActive(num int) Option
- func WithPoolMaxIdle(num int) Option
- func WithServerName(serverName string) Option
- type PoolStater
- type PoolStats
Constants ¶
View Source
const ( CodeSuccess = "Success" CodeFail = "Fail" CodeNotFound = "NotFound" CodeInvalidType = "InvalidType" )
Variables ¶
View Source
var ( ReceivedCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "bucketeer", Subsystem: "redis", Name: "received_total", Help: "Total number of received commands.", }, []string{"version", "server", "command"}) HandledCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "bucketeer", Subsystem: "redis", Name: "handled_total", Help: "Total number of completed commands.", }, []string{"version", "server", "command", "code"}) HandledHistogram = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "bucketeer", Subsystem: "redis", Name: "handling_seconds", Help: "Histogram of command response latency (seconds).", Buckets: prometheus.DefBuckets, }, []string{"version", "server", "command", "code"}) )
View Source
var ErrNil = redis.ErrNil
Functions ¶
func RegisterMetrics ¶
func RegisterMetrics(r metrics.Registerer, version, server string, stater PoolStater)
Types ¶
type Cluster ¶
type ConnectionOptions ¶
type ConnectionOptions func(*connectionOptions)
func WithReadOnly ¶
func WithReadOnly() ConnectionOptions
func WithoutRetry ¶
func WithoutRetry() ConnectionOptions
type Option ¶
type Option func(*options)
func WithDialConnectTimeout ¶
func WithDialPassword ¶
func WithLogger ¶
func WithMetrics ¶
func WithMetrics(r metrics.Registerer) Option
func WithPoolIdleTimeout ¶
func WithPoolMaxActive ¶
func WithPoolMaxIdle ¶
func WithServerName ¶
type PoolStater ¶
type PoolStater interface {
Stats() PoolStats
}
Click to show internal directories.
Click to hide internal directories.