doctor

package
v0.0.0-...-c344868 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigKey

type BigKey struct {
	Key              string `json:"key,omitempty" xml:"key,omitempty"`
	Type             string `json:"type,omitempty" xml:"type,omitempty"`
	Encoding         string `json:"encoding,omitempty" xml:"encoding,omitempty"`
	SerializedLength int64  `json:"serializedLength,omitempty" xml:"serializedLength,omitempty"`
	// Number of elements of the key, acquired by following commands:
	//   STRLEN <string>
	//   HLEN <hash>
	//   LLEN <list>
	//   SCARD <set>
	//   ZCARD <sorted set>
	Cardinality int64 `json:"cardinality,omitempty" xml:"cardinality,omitempty"`
}

func (*BigKey) Accept

func (bk *BigKey) Accept(v Visitor) error

type Doctor

type Doctor struct {
	// contains filtered or unexported fields
}

func New

func New(redisOpts *redis.UniversalOptions, outputer Visitor) *Doctor

func (*Doctor) Diagnose

func (d *Doctor) Diagnose(ctx context.Context, symptom string, opts Options) error

type Entry

type Entry interface {
	Accept(Visitor) error
}

type HotKey

type HotKey struct {
	Key       string `json:"key,omitempty" xml:"key,omitempty"`
	Type      string `json:"type,omitempty" xml:"type,omitempty"`
	Frequency int64  `json:"frequency,omitempty" xml:"frequency,omitempty"`
}

func (*HotKey) Accept

func (hk *HotKey) Accept(v Visitor) error

type Options

type Options struct {
	Pattern     string
	Type        string
	Length      int64
	Cardinality int64
	Frequency   int64
	Batch       int
	Limit       int
}

type SlowLog

type SlowLog struct {
	ID         int64         `json:"id,omitempty" xml:"id,omitempty"`
	Time       time.Time     `json:"time,omitempty" xml:"time,omitempty"`
	Duration   time.Duration `json:"duration,omitempty" xml:"duration,omitempty"`
	Args       []string      `json:"args,omitempty" xml:"args,omitempty"`
	ClientAddr string        `json:"clientAddr,omitempty" xml:"clientAddr,omitempty"`
	ClientName string        `json:"clientName,omitempty" xml:"clientName,omitempty"`
}

Copied from https://pkg.go.dev/github.com/redis/go-redis/v9@v9.0.2#SlowLog

func (*SlowLog) Accept

func (sl *SlowLog) Accept(v Visitor) error

type Visitor

type Visitor interface {
	VisitBigKey(key *BigKey) error
	VisitHotKey(key *HotKey) error
	VisitSlowLog(log *SlowLog) error
}

Jump to

Keyboard shortcuts

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