Documentation
¶
Overview ¶
Package observability collects metrics (per-command calls and latency), the slow log, and MONITOR streaming (tracing.go).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandSnapshot ¶
CommandSnapshot is a plain copy of CommandStats.
type CommandStats ¶
type Metrics ¶
type Metrics struct {
Started time.Time
TotalCommands atomic.Int64
TotalConnections atomic.Int64
RejectedConns atomic.Int64
ConnectedClients atomic.Int64
NetInputBytes atomic.Int64
NetOutputBytes atomic.Int64
// contains filtered or unexported fields
}
func NewMetrics ¶
func NewMetrics() *Metrics
func (*Metrics) Commands ¶
func (m *Metrics) Commands() []CommandSnapshot
Commands returns stats for every command that has run, sorted by name.
func (*Metrics) ResetCommands ¶
func (m *Metrics) ResetCommands()
ResetCommands clears per-command stats (CONFIG RESETSTAT).
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor streams every executed command to MONITOR clients, in the same format as Redis: 1700000000.123456 [0 127.0.0.1:5000] "SET" "a" "1"
func NewMonitor ¶
func NewMonitor() *Monitor
func (*Monitor) Active ¶
Active reports whether anyone is monitoring (cheap check before formatting).
func (*Monitor) Add ¶
func (m *Monitor) Add(s Subscriber)
func (*Monitor) Remove ¶
func (m *Monitor) Remove(s Subscriber)
type SlowEntry ¶
type SlowEntry struct {
ID int64
Time time.Time
Duration time.Duration
Args []string
ClientAddr string
ClientName string
}
SlowEntry is one SLOWLOG record.
type Slowlog ¶
type Slowlog struct {
// contains filtered or unexported fields
}
Slowlog keeps the most recent commands slower than a threshold.
func NewSlowlog ¶
func NewSlowlog() *Slowlog