mirror of https://github.com/tikv/client-go.git
parent
f65172694b
commit
3cc2459779
|
|
@ -358,7 +358,8 @@ func (c *RPCClient) updateTiKVSendReqHistogram(req *tikvrpc.Request, start time.
|
|||
if !ok {
|
||||
reqType := req.Type.String()
|
||||
storeID := strconv.FormatUint(req.Context.GetPeer().GetStoreId(), 10)
|
||||
v = metrics.TiKVSendReqHistogram.WithLabelValues(reqType, storeID)
|
||||
staleRead := strconv.FormatBool(req.StaleRead)
|
||||
v = metrics.TiKVSendReqHistogram.WithLabelValues(reqType, storeID, staleRead)
|
||||
sendReqHistCache.Store(key, v)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ var (
|
|||
TiKVTxnCmdHistogram *prometheus.HistogramVec
|
||||
TiKVBackoffHistogram *prometheus.HistogramVec
|
||||
TiKVSendReqHistogram *prometheus.HistogramVec
|
||||
TiKVCoprocessorHistogram prometheus.Histogram
|
||||
TiKVCoprocessorHistogram *prometheus.HistogramVec
|
||||
TiKVLockResolverCounter *prometheus.CounterVec
|
||||
TiKVRegionErrorCounter *prometheus.CounterVec
|
||||
TiKVTxnWriteKVCountHistogram prometheus.Histogram
|
||||
|
|
@ -108,6 +108,7 @@ const (
|
|||
LblAddress = "address"
|
||||
LblFromStore = "from_store"
|
||||
LblToStore = "to_store"
|
||||
LblStaleRead = "stale_read"
|
||||
)
|
||||
|
||||
func initMetrics(namespace, subsystem string) {
|
||||
|
|
@ -136,16 +137,16 @@ func initMetrics(namespace, subsystem string) {
|
|||
Name: "request_seconds",
|
||||
Help: "Bucketed histogram of sending request duration.",
|
||||
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
|
||||
}, []string{LblType, LblStore})
|
||||
}, []string{LblType, LblStore, LblStaleRead})
|
||||
|
||||
TiKVCoprocessorHistogram = prometheus.NewHistogram(
|
||||
TiKVCoprocessorHistogram = prometheus.NewHistogramVec(
|
||||
prometheus.HistogramOpts{
|
||||
Namespace: namespace,
|
||||
Subsystem: subsystem,
|
||||
Name: "cop_duration_seconds",
|
||||
Help: "Run duration of a single coprocessor task, includes backoff time.",
|
||||
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
|
||||
})
|
||||
}, []string{LblStore, LblStaleRead})
|
||||
|
||||
TiKVLockResolverCounter = prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
|
|
|
|||
Loading…
Reference in New Issue