Skip to content

Commit

Permalink
*: update client-go and fix metrics (pingcap#29354)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisaer authored Nov 2, 2021
1 parent 55a38a1 commit 5518f8b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
github.com/tikv/client-go/v2 v2.0.0-alpha.0.20211101035952-9ec50224bea6
github.com/tikv/client-go/v2 v2.0.0-alpha.0.20211102120533-b8cc5a319d96
github.com/tikv/pd v1.1.0-beta.0.20211029083450-e65f0c55b6ae
github.com/twmb/murmur3 v1.1.3
github.com/uber/jaeger-client-go v2.22.1+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,8 @@ github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfK
github.com/tidwall/gjson v1.3.5/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tikv/client-go/v2 v2.0.0-alpha.0.20211101035952-9ec50224bea6 h1:hRn82rVDw91KBSoMT7eAv8qPIxFMU6+f5K35fP5ULbY=
github.com/tikv/client-go/v2 v2.0.0-alpha.0.20211101035952-9ec50224bea6/go.mod h1:iiwtsCxcbNLK5i9VRYGvdcihgHXTKy2ukWjoaJsrphg=
github.com/tikv/client-go/v2 v2.0.0-alpha.0.20211102120533-b8cc5a319d96 h1:+PffHhOZm7OpC+VrL10ahT/KwloECT4ZtSJ0D8SzmYQ=
github.com/tikv/client-go/v2 v2.0.0-alpha.0.20211102120533-b8cc5a319d96/go.mod h1:iiwtsCxcbNLK5i9VRYGvdcihgHXTKy2ukWjoaJsrphg=
github.com/tikv/pd v1.1.0-beta.0.20211029083450-e65f0c55b6ae h1:PmnkhiOopgMZYDQ7Htj1kt/zwW4MEOUL+Dem6WLZISY=
github.com/tikv/pd v1.1.0-beta.0.20211029083450-e65f0c55b6ae/go.mod h1:varH0IE0jJ9E9WN2Ei/N6pajMlPkcXdDEf7f5mmsUVQ=
github.com/tklauser/go-sysconf v0.3.4 h1:HT8SVixZd3IzLdfs/xlpq0jeSfTX57g1v6wB1EuzV7M=
Expand Down
4 changes: 2 additions & 2 deletions store/copr/coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ func (worker *copIteratorWorker) handleTaskOnce(bo *Backoffer, task *copTask, ch
if worker.req.IsStaleness {
req.EnableStaleRead()
}
staleRead := req.GetStaleRead()
ops := make([]tikv.StoreSelectorOption, 0, 2)
if len(worker.req.MatchStoreLabels) > 0 {
ops = append(ops, tikv.WithMatchLabels(worker.req.MatchStoreLabels))
Expand All @@ -744,8 +745,7 @@ func (worker *copIteratorWorker) handleTaskOnce(bo *Backoffer, task *copTask, ch
worker.logTimeCopTask(costTime, task, bo, resp)
}
storeID := strconv.FormatUint(req.Context.GetPeer().GetStoreId(), 10)
staleRead := strconv.FormatBool(req.StaleRead)
metrics.TiKVCoprocessorHistogram.WithLabelValues(storeID, staleRead).Observe(costTime.Seconds())
metrics.TiKVCoprocessorHistogram.WithLabelValues(storeID, strconv.FormatBool(staleRead)).Observe(costTime.Seconds())

if task.cmdType == tikvrpc.CmdCopStream {
return worker.handleCopStreamResult(bo, rpcCtx, resp.Resp.(*tikvrpc.CopStreamResponse), task, ch, costTime)
Expand Down

0 comments on commit 5518f8b

Please sign in to comment.