MCPcopy
hub / github.com/redis/go-redis / Record

Method Record

command_recorder_test.go:27–36  ·  view source on GitHub ↗

Record adds a command to the recorder.

(cmd string)

Source from the content-addressed store, hash-verified

25
26// Record adds a command to the recorder.
27func (r *commandRecorder) Record(cmd string) {
28 cmd = strings.ToLower(cmd)
29 r.mu.Lock()
30 defer r.mu.Unlock()
31
32 r.commands = append(r.commands, cmd)
33 if len(r.commands) > r.maxSize {
34 r.commands = r.commands[1:]
35 }
36}
37
38// LastCommands returns a copy of the recorded commands.
39func (r *commandRecorder) LastCommands() []string {

Callers 10

ProcessHookMethod · 0.80
ProcessPipelineHookMethod · 0.80
DialHookMethod · 0.80
ProcessHookMethod · 0.80
ProcessPipelineHookMethod · 0.80
RecordStreamLagMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected