mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-10 00:29:01 +02:00
52 lines
1.6 KiB
Go
52 lines
1.6 KiB
Go
package memcache
|
|
|
|
import "github.com/go-kratos/kratos/pkg/stat/metric"
|
|
|
|
const namespace = "memcache_client"
|
|
|
|
var (
|
|
_metricReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{
|
|
Namespace: namespace,
|
|
Subsystem: "requests",
|
|
Name: "duration_ms",
|
|
Help: "memcache client requests duration(ms).",
|
|
Labels: []string{"name", "addr", "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: "memcache client requests error count.",
|
|
Labels: []string{"name", "addr", "command", "error"},
|
|
})
|
|
_metricConnTotal = metric.NewCounterVec(&metric.CounterVecOpts{
|
|
Namespace: namespace,
|
|
Subsystem: "connections",
|
|
Name: "total",
|
|
Help: "memcache client connections total count.",
|
|
Labels: []string{"name", "addr", "state"},
|
|
})
|
|
_metricConnCurrent = metric.NewGaugeVec(&metric.GaugeVecOpts{
|
|
Namespace: namespace,
|
|
Subsystem: "connections",
|
|
Name: "current",
|
|
Help: "memcache client connections current.",
|
|
Labels: []string{"name", "addr", "state"},
|
|
})
|
|
_metricHits = metric.NewCounterVec(&metric.CounterVecOpts{
|
|
Namespace: namespace,
|
|
Subsystem: "",
|
|
Name: "hits_total",
|
|
Help: "memcache client hits total.",
|
|
Labels: []string{"name", "addr"},
|
|
})
|
|
_metricMisses = metric.NewCounterVec(&metric.CounterVecOpts{
|
|
Namespace: namespace,
|
|
Subsystem: "",
|
|
Name: "misses_total",
|
|
Help: "memcache client misses total.",
|
|
Labels: []string{"name", "addr"},
|
|
})
|
|
)
|