mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
Add missing Tx instrumentation
This commit is contained in:
@ -56,3 +56,25 @@ func ExamplePipeline_instrumentation() {
|
||||
// Output: pipeline starting processing: [ping: ping: ]
|
||||
// pipeline finished processing: [ping: PONG ping: PONG]
|
||||
}
|
||||
|
||||
func ExampleWatch_instrumentation() {
|
||||
rdb := redis.NewClient(&redis.Options{
|
||||
Addr: ":6379",
|
||||
})
|
||||
rdb.AddHook(redisHook{})
|
||||
|
||||
rdb.Watch(func(tx *redis.Tx) error {
|
||||
tx.Ping()
|
||||
tx.Ping()
|
||||
return nil
|
||||
}, "foo")
|
||||
// Output:
|
||||
// starting processing: <watch foo: >
|
||||
// finished processing: <watch foo: OK>
|
||||
// starting processing: <ping: >
|
||||
// finished processing: <ping: PONG>
|
||||
// starting processing: <ping: >
|
||||
// finished processing: <ping: PONG>
|
||||
// starting processing: <unwatch: >
|
||||
// finished processing: <unwatch: OK>
|
||||
}
|
||||
|
Reference in New Issue
Block a user