1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

support for slowlog command

This commit is contained in:
wziww
2020-06-11 15:24:04 +08:00
committed by Vladimir Mihailenco
parent 4306c58d43
commit be9ae84c6f
4 changed files with 155 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"errors"
"io"
"strconv"
"time"
"github.com/go-redis/redis/v8/internal"
@ -2306,8 +2307,11 @@ func (c cmdable) SlaveOf(ctx context.Context, host, port string) *StatusCmd {
return cmd
}
func (c cmdable) SlowLog(ctx context.Context) {
panic("not implemented")
func (c cmdable) SlowLog(ctx context.Context, num int64) *SlowLogCmd {
n := strconv.FormatInt(num, 10)
cmd := NewSlowLogCmd(context.Background(), "slowlog", "get", n)
_ = c(ctx, cmd)
return cmd
}
func (c cmdable) Sync(ctx context.Context) {