redis

package
v6.1.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

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

func NewHarvester(conn rd.Conn) *Harvester

NewHarvester creates a new harvester with the given connection

func (*Harvester) ID

func (h *Harvester) ID() uuid.UUID

ID returns the unique harvester ID

func (*Harvester) Run

func (h *Harvester) Run() error

Run starts a new redis harvester

func (*Harvester) Stop

func (h *Harvester) Stop()

Stop stopps the harvester

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) Run

func (p *Prospector) Run()

Run runs the prospector

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL