ocredis

package
v0.0.0-...-f0e8901 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, addr string) *redis.Client

NewClient creates a trace instrumented redis.Client. It takes context.Context as a first argument because clients can cheaply be created an discarded, and for a full trace you'll want to create a client that uses the provided context. For example:

req, _ := http.NewRequest()
req = req.WithContext(ctx)
...
client := NewClient(req.Context(), redisAddr)
client.HMSet("results", keyValueDict)

func PerCommandTracer

func PerCommandTracer(ctx context.Context) func(oldProcess func(cmd redis.Cmder) error) func(redis.Cmder) error

PerCommandTracer provides the instrumented WrapProcess function that you can attach to any client. It specifically takes in a context.Context as the first argument because you could be using the same client but wrapping it in a different context.

func WrapClient

func WrapClient(ctx context.Context, origClient *redis.Client) *redis.Client

WrapClient takes a vanilla redis.Client and returns a trace instrumented version

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL