You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
642 B
Go
24 lines
642 B
Go
package redis
|
|
|
|
import "github.com/zeromicro/go-zero/core/metric"
|
|
|
|
const namespace = "redis_client"
|
|
|
|
var (
|
|
metricReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
|
|
Namespace: namespace,
|
|
Subsystem: "requests",
|
|
Name: "duration_ms",
|
|
Help: "redis client requests duration(ms).",
|
|
Labels: []string{"command"},
|
|
Buckets: []float64{5, 10, 25, 50, 100, 250, 500, 1000, 2500},
|
|
})
|
|
metricReqErr = metric.NewCounterVec(&metric.CounterVecOpts{
|
|
Namespace: namespace,
|
|
Subsystem: "requests",
|
|
Name: "error_total",
|
|
Help: "redis client requests error count.",
|
|
Labels: []string{"command", "error"},
|
|
})
|
|
)
|