Documentation
¶
Overview ¶
Package redisstats records Redis-compatible command latency without ever retaining keys, values, arguments, or connection strings.
Index ¶
- Constants
- Variables
- type Entry
- type Frozen
- type GenerationCollector
- func (c *GenerationCollector) BeginBoundary(ctx context.Context, runID string, epoch runctl.Epoch) (runctl.BoundaryResult, error)
- func (c *GenerationCollector) Collect(handle runctl.GenerationHandle) (any, error)
- func (c *GenerationCollector) Drain(ctx context.Context, handle runctl.GenerationHandle) error
- func (c *GenerationCollector) Freeze(ctx context.Context, runID string, epoch runctl.Epoch) (runctl.BoundaryResult, error)
- func (c *GenerationCollector) Name() string
- func (c *GenerationCollector) Release(handle runctl.GenerationHandle)
- type Registry
Constants ¶
View Source
const ( DefaultMaxCommands = 256 MaxCommandBytes = 64 OverflowCommand = "(other)" )
View Source
const SectionName = "redis"
Variables ¶
View Source
var ( ErrForeignHandle = errors.New("redisstats: foreign generation handle") ErrNotDrained = errors.New("redisstats: generation was not drained") ErrHandleReleased = errors.New("redisstats: generation handle was released") )
View Source
var Default = NewRegistry(DefaultMaxCommands)
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Command string `json:"command"`
Count int64 `json:"count"`
ErrorCount int64 `json:"error_count"`
Total time.Duration `json:"total_ns"`
Avg time.Duration `json:"avg_ns"`
Max time.Duration `json:"max_ns"`
P95 time.Duration `json:"p95_ns"`
}
Entry is one sanitized command aggregate.
type GenerationCollector ¶
type GenerationCollector struct {
// contains filtered or unexported fields
}
func NewGenerationCollector ¶
func NewGenerationCollector(registry *Registry) *GenerationCollector
func (*GenerationCollector) BeginBoundary ¶
func (c *GenerationCollector) BeginBoundary(ctx context.Context, runID string, epoch runctl.Epoch) (runctl.BoundaryResult, error)
func (*GenerationCollector) Collect ¶
func (c *GenerationCollector) Collect(handle runctl.GenerationHandle) (any, error)
func (*GenerationCollector) Drain ¶
func (c *GenerationCollector) Drain(ctx context.Context, handle runctl.GenerationHandle) error
func (*GenerationCollector) Freeze ¶
func (c *GenerationCollector) Freeze(ctx context.Context, runID string, epoch runctl.Epoch) (runctl.BoundaryResult, error)
func (*GenerationCollector) Name ¶
func (c *GenerationCollector) Name() string
func (*GenerationCollector) Release ¶
func (c *GenerationCollector) Release(handle runctl.GenerationHandle)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is safe for concurrent clients and atomic generation rotation.
func NewRegistry ¶
Click to show internal directories.
Click to hide internal directories.