1
0
mirror of https://github.com/redis/go-redis.git synced 2025-11-10 00:00:57 +03:00

feat: support for latency command (#3584)

* support for latency command

* add NonRedisEnterprise label for latency test
This commit is contained in:
destinyoooo
2025-11-06 03:10:35 +08:00
committed by GitHub
parent 60b748bf1a
commit 63fbaafcef
3 changed files with 175 additions and 0 deletions

View File

@@ -214,6 +214,8 @@ type Cmdable interface {
Time(ctx context.Context) *TimeCmd
DebugObject(ctx context.Context, key string) *StringCmd
MemoryUsage(ctx context.Context, key string, samples ...int) *IntCmd
Latency(ctx context.Context) *LatencyCmd
LatencyReset(ctx context.Context, events ...interface{}) *StatusCmd
ModuleLoadex(ctx context.Context, conf *ModuleLoadexConfig) *StringCmd
@@ -673,6 +675,22 @@ func (c cmdable) SlowLogGet(ctx context.Context, num int64) *SlowLogCmd {
return cmd
}
func (c cmdable) Latency(ctx context.Context) *LatencyCmd {
cmd := NewLatencyCmd(ctx, "latency", "latest")
_ = c(ctx, cmd)
return cmd
}
func (c cmdable) LatencyReset(ctx context.Context, events ...interface{}) *StatusCmd {
args := make([]interface{}, 2+len(events))
args[0] = "latency"
args[1] = "reset"
copy(args[2:], events)
cmd := NewStatusCmd(ctx, args...)
_ = c(ctx, cmd)
return cmd
}
func (c cmdable) Sync(_ context.Context) {
panic("not implemented")
}