| 63 | } |
| 64 | |
| 65 | func 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 | |
| 88 | func ExampleClient_Watch_instrumentation() { |
| 89 | rdb := redis.NewClient(&redis.Options{ |