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

Method ProcessPipelineHook

example_instrumentation_test.go:33–44  ·  example_instrumentation_test.go::redisHook.ProcessPipelineHook
(hook redis.ProcessPipelineHook)

Source from the content-addressed store, hash-verified

31}
32
33func (redisHook) ProcessPipelineHook(hook redis.ProcessPipelineHook) redis.ProcessPipelineHook {
34 return func(ctx context.Context, cmds []redis.Cmder) error {
35 names := make([]string, 0, len(cmds))
36 for _, cmd := range cmds {
37 names = append(names, fmt.Sprintf("%v", cmd.Args()))
38 }
39 fmt.Printf("pipeline starting processing: %v\n", names)
40 err := hook(ctx, cmds)
41 fmt.Printf("pipeline finished processing: %v\n", names)
42 return err
43 }
44}
45
46func Example_instrumentation() {
47 rdb := redis.NewClient(&redis.Options{

Callers

nothing calls this directly

Calls 3

hookStruct · 0.85
ArgsMethod · 0.65
PrintfMethod · 0.65

Tested by

no test coverage detected