Documentation ¶
Overview ¶
Package redis instruments redis interactions with Open Census
Index ¶
- Variables
- func RegisterAllViews() error
- type BoolCmd
- type Client
- type Cmd
- type HashClient
- type IntCmd
- type StatusCmd
- type StringCmd
- type StringSliceCmd
- type Wrapper
- func (w *Wrapper) Decr(ctx context.Context, key string) (cmd IntCmd)
- func (w *Wrapper) Get(ctx context.Context, key string) (cmd StringCmd)
- func (w *Wrapper) HGet(ctx context.Context, key, field string) (cmd StringCmd)
- func (w *Wrapper) HKeys(ctx context.Context, key string) (cmd StringSliceCmd)
- func (w *Wrapper) HSet(ctx context.Context, key, field, value string) (cmd BoolCmd)
- func (w *Wrapper) Incr(ctx context.Context, key string) (cmd IntCmd)
- func (w *Wrapper) Ping(ctx context.Context) (cmd StatusCmd)
- func (w *Wrapper) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) (cmd StatusCmd)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// GoRedisName is the name of the redis instance.
GoRedisInstanceName, _ = tag.NewKey("go_redis_instance_name")
// GoRedisMethod is the client method called.
GoRedisMethod, _ = tag.NewKey("go_redis_method")
// GoRedisStatus identifies the command status
GoRedisStatus, _ = tag.NewKey("go_redis_status")
DefaultTags = []tag.Key{
GoRedisMethod,
GoRedisStatus,
}
)
The following tags are aooplied to stats recorded by this package
View Source
var ( MeasureLatencyMs = stats.Int64("go.redis/latency", "The latency of calls in milliseconds", stats.UnitMilliseconds) MeasureResponseBytes = stats.Int64("go.redis/received_bytes", "The number of bytes returned from a command", stats.UnitBytes) )
The following measures are supported for use in custom views.
View Source
var ( DefaultSizeDistribution = view.Distribution( 1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296, ) DefaultMillisecondsDistribution = view.Distribution( 0.0, 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 5.0, 10.0, 25.0, 50.0, 100.0, 200.0, 400.0, 600.0, 800.0, 1000.0, 1500.0, 2000.0, 2500.0, 5000.0, 10000.0, 20000.0, 40000.0, 100000.0, 200000.0, 500000.0, ) )
Default distributions used by views in this package
View Source
var ( GoRedisLatencyView = &view.View{ Name: "go.redis/client/latency", Description: "The distribution of latency of various calls in milliseconds", Measure: MeasureLatencyMs, Aggregation: DefaultMillisecondsDistribution, TagKeys: DefaultTags, } GoRedisCallsView = &view.View{ Name: "go.redis/client/calls", Description: "The number of various calls of methods", Measure: MeasureLatencyMs, Aggregation: view.Count(), TagKeys: DefaultTags, } GoRedisBytesView = &view.View{ Name: "go.redis/client/received_bytes", Description: "Total bytes received from Redis", Measure: MeasureResponseBytes, Aggregation: DefaultSizeDistribution, TagKeys: DefaultTags, } DefaultViews = []*view.View{GoRedisLatencyView, GoRedisCallsView, GoRedisBytesView} )
Package cache provides some convenience views. You still need to register these views for data to actually be collected. You can use the RegisterAllViews function for this.
Functions ¶
func RegisterAllViews ¶
func RegisterAllViews() error
RegisterAllViews registers all the cache views to enable collection of stats
Types ¶
type HashClient ¶
type StringSliceCmd ¶
Click to show internal directories.
Click to hide internal directories.