Skip to content

Commit

Permalink
pick for tikv#4446, tikv#4512
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <admin@liudos.us>
  • Loading branch information
lhy1024 committed Jan 21, 2022
1 parent 046d2e9 commit 015d7c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/statistics/hot_peer_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ func buildRegion(kind FlowKind, peerCount int, interval uint64) *core.RegionInfo
core.SetReportInterval(interval),
core.SetReadBytes(10*1024*1024*interval),
core.SetReadKeys(10*1024*1024*interval),
core.SetReadQuery(1024*interval),
)
case WriteFlow:
return core.NewRegionInfo(
Expand All @@ -283,6 +284,7 @@ func buildRegion(kind FlowKind, peerCount int, interval uint64) *core.RegionInfo
core.SetReportInterval(interval),
core.SetWrittenBytes(10*1024*1024*interval),
core.SetWrittenKeys(10*1024*1024*interval),
core.SetWrittenQuery(1024*interval),
)
default:
return nil
Expand Down Expand Up @@ -423,7 +425,7 @@ func (t *testHotPeerCache) TestRemoveFromCache(c *C) {
// check whether cold cache is cleared
var isClear bool
intervalSums = make(map[uint64]int)
region = region.Clone(core.SetWrittenBytes(0), core.SetWrittenKeys(0))
region = region.Clone(core.SetWrittenBytes(0), core.SetWrittenKeys(0), core.SetWrittenQuery(0))
for i := 1; i <= 200; i++ {
rets := checker(c, cache, region)
checkIntervalSumContinuous(c, intervalSums, rets, interval)
Expand Down Expand Up @@ -476,7 +478,7 @@ func (t *testHotPeerCache) TestRemoveFromCacheRandom(c *C) {
// check whether cold cache is cleared
var isClear bool
intervalSums = make(map[uint64]int)
region = region.Clone(core.SetWrittenBytes(0), core.SetWrittenKeys(0))
region = region.Clone(core.SetWrittenBytes(0), core.SetWrittenKeys(0), core.SetWrittenQuery(0))
for i := 1; i < 200; i++ {
step(i)
if len(cache.storesOfRegion[region.GetID()]) == 0 {
Expand Down

0 comments on commit 015d7c2

Please sign in to comment.