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

Function ExamplePipeline_instrumentation

example_instrumentation_test.go:65–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63}
64
65func ExamplePipeline_instrumentation() {
66 rdb := redis.NewClient(&redis.Options{
67 Addr: ":6379",
68 DisableIdentity: true,
69 })
70 rdb.AddHook(redisHook{})
71
72 rdb.Pipelined(ctx, func(pipe redis.Pipeliner) error {
73 pipe.Ping(ctx)
74 pipe.Ping(ctx)
75 return nil
76 })
77 // Output:
78 // pipeline starting processing: [[ping] [ping]]
79 // dialing tcp :6379
80 // finished dialing tcp :6379
81 // starting processing: <[hello 3]>
82 // finished processing: <[hello 3]>
83 // starting processing: <[client maint_notifications on moving-endpoint-type internal-ip]>
84 // finished processing: <[client maint_notifications on moving-endpoint-type internal-ip]>
85 // pipeline finished processing: [[ping] [ping]]
86}
87
88func ExampleClient_Watch_instrumentation() {
89 rdb := redis.NewClient(&redis.Options{

Callers

nothing calls this directly

Calls 3

PipelinedMethod · 0.95
AddHookMethod · 0.65
PingMethod · 0.65

Tested by

no test coverage detected