Fix that histogram is not inserted into rpcNetLatencyHistCache (#563)

* Fix that histogram is not inserted into rpcNetLatencyHistCache

Signed-off-by: Yilin Chen <sticnarf@gmail.com>

* downgrade golangci-lint to avoid gofmt complaints temporarily

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
This commit is contained in:
Yilin Chen 2022-08-09 11:48:08 +08:00 committed by GitHub
parent e10841f2d1
commit 2ed2113d10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -46,4 +46,6 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v2.5.2
with:
version: v1.47.3

View File

@ -446,7 +446,7 @@ func (c *RPCClient) updateTiKVSendReqHistogram(req *tikvrpc.Request, resp *tikvr
storeIDStr = strconv.FormatUint(storeID, 10)
}
latHist = metrics.TiKVRPCNetLatencyHistogram.WithLabelValues(storeIDStr)
sendReqHistCache.Store(storeID, latHist)
rpcNetLatencyHistCache.Store(storeID, latHist)
}
latency := elapsed - time.Duration(execDetail.TimeDetail.TotalRpcWallTimeNs)*time.Nanosecond
latHist.(prometheus.Observer).Observe(latency.Seconds())