Documentation ¶
Overview ¶
Package redis package contains prospector and harvester to read the redis slow log
The redis slow log is stored in memory. The slow log can be activate on the redis command line as following:
CONFIG SET slowlog-log-slower-than 2000000
This sets the value of the slow log to 2000000 micro seconds (2s). All queries taking longer will be reported.
As the slow log is in memory, it can be configured how many items it consists:
CONFIG SET slowlog-max-len 200
This sets the size of the slow log to 200 entries. In case the slow log is full, older entries are dropped.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePool ¶
func CreatePool( host, password, network string, maxConn int, idleTimeout, connTimeout time.Duration, ) *rd.Pool
CreatePool creates a redis connection pool NOTE: This code is copied from the redis pool handling in metricbeat
func NewProspector ¶
func NewProspector(cfg *common.Config, outletFactory channel.Factory, context prospector.Context) (prospector.Prospectorer, error)
NewProspector creates a new redis prospector
Types ¶
type Harvester ¶
type Harvester struct {
// contains filtered or unexported fields
}
Harvester contains all redis harvester data
func NewHarvester ¶
NewHarvester creates a new harvester with the given connection
type Prospector ¶
type Prospector struct {
// contains filtered or unexported fields
}
Prospector is a prospector for redis
func (*Prospector) LoadStates ¶
func (p *Prospector) LoadStates(states []file.State) error
LoadStates loads the states
func (*Prospector) Stop ¶
func (p *Prospector) Stop()
Stop stopps the prospector and all its harvesters
func (*Prospector) Wait ¶
func (p *Prospector) Wait()
Wait waits for the propsector to be completed. Not implemented.