Skip to content

Commit ef829aa

Browse files
committed
improve region request log for diagnose (#1300)
* improve region request log for diagnose Signed-off-by: crazycs520 <[email protected]> * rename struct Signed-off-by: crazycs520 <[email protected]> * refine region error metric with store id label and add rpc error metric Signed-off-by: crazycs520 <[email protected]> * refine comment Signed-off-by: crazycs520 <[email protected]> * refine code Signed-off-by: crazycs520 <[email protected]> * restrict log Signed-off-by: crazycs520 <[email protected]> * refine code Signed-off-by: crazycs520 <[email protected]> * refine Signed-off-by: crazycs520 <[email protected]> * refine Signed-off-by: crazycs520 <[email protected]> * refine log Signed-off-by: crazycs520 <[email protected]> * refine code Signed-off-by: crazycs520 <[email protected]> * fix test Signed-off-by: crazycs520 <[email protected]> * address comment Signed-off-by: crazycs520 <[email protected]> * refine Signed-off-by: crazycs520 <[email protected]> * refine Signed-off-by: crazycs520 <[email protected]> * refine log Signed-off-by: crazycs520 <[email protected]> --------- Signed-off-by: crazycs520 <[email protected]>
1 parent 6b7d200 commit ef829aa

File tree

10 files changed

+386
-119
lines changed

10 files changed

+386
-119
lines changed

integration_tests/main_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func TestMain(m *testing.M) {
2727
opts := []goleak.Option{
2828
goleak.IgnoreTopFunction("github.com/pingcap/goleveldb/leveldb.(*DB).mpoolDrain"),
2929
goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/txnkv/transaction.keepAlive"), // TODO: fix ttlManager goroutine leak
30+
goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/config/retry.(*Config).createBackoffFn.newBackoffFn.func2"),
3031
}
3132

3233
goleak.VerifyTestMain(m, opts...)

integration_tests/snapshot_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,13 @@ func (s *testSnapshotSuite) TestSnapshotThreadSafe() {
303303

304304
func (s *testSnapshotSuite) TestSnapshotRuntimeStats() {
305305
reqStats := tikv.NewRegionRequestRuntimeStats()
306-
tikv.RecordRegionRequestRuntimeStats(reqStats.Stats, tikvrpc.CmdGet, time.Second)
307-
tikv.RecordRegionRequestRuntimeStats(reqStats.Stats, tikvrpc.CmdGet, time.Millisecond)
306+
reqStats.RecordRPCRuntimeStats(tikvrpc.CmdGet, time.Second)
307+
reqStats.RecordRPCRuntimeStats(tikvrpc.CmdGet, time.Millisecond)
308308
snapshot := s.store.GetSnapshot(0)
309309
runtimeStats := &txnkv.SnapshotRuntimeStats{}
310310
snapshot.SetRuntimeStats(runtimeStats)
311-
snapshot.MergeRegionRequestStats(reqStats.Stats)
312-
snapshot.MergeRegionRequestStats(reqStats.Stats)
311+
snapshot.MergeRegionRequestStats(reqStats)
312+
snapshot.MergeRegionRequestStats(reqStats)
313313
bo := tikv.NewBackofferWithVars(context.Background(), 2000, nil)
314314
err := bo.BackoffWithMaxSleepTxnLockFast(5, errors.New("test"))
315315
s.Nil(err)

0 commit comments

Comments
 (0)