Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Jan 21, 2022
1 parent eb1dc00 commit d1f8b55
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion server/api/region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func (s *testRegionSuite) SetUpSuite(c *C) {
s.urlPrefix = fmt.Sprintf("%s%s/api/v1", addr, apiPrefix)

mustBootstrapCluster(c, s.svr)
s.svr.GetRaftCluster().SetPrepared()
}

func (s *testRegionSuite) TearDownSuite(c *C) {
Expand Down
9 changes: 2 additions & 7 deletions server/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ func (c *RaftCluster) InitCluster(
c.labelLevelStats = statistics.NewLabelStatistics()
c.hotStat = statistics.NewHotStat(c.ctx)
c.changedRegions = make(chan *core.RegionInfo, defaultChangedRegionsLimit)
c.statsTaskCh = make(chan []*statsTask, defaultStatsJobLimit)
}

// Start starts a cluster.
Expand Down Expand Up @@ -1283,11 +1282,8 @@ func (c *RaftCluster) collectStatsMetrics() {
}

func (c *RaftCluster) collectHotStatsMetrics() {
c.RLock()
hotStat := c.hotStat
c.RUnlock()
// collect hot cache metrics
hotStat.CollectMetrics()
c.hotStat.CollectMetrics()
}

func (c *RaftCluster) resetClusterMetrics() {
Expand All @@ -1298,10 +1294,9 @@ func (c *RaftCluster) resetClusterMetrics() {
}
c.regionStats.Reset()
c.labelLevelStats.Reset()
hotStat := c.hotStat
c.RUnlock()
// reset hot cache metrics
hotStat.ResetMetrics()
c.hotStat.ResetMetrics()
}

func (c *RaftCluster) collectHealthStatus() {
Expand Down
7 changes: 5 additions & 2 deletions server/statistics/topn.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,11 @@ func (hp *indexedHeap) Get(id uint64) TopNItem {
if !ok {
return nil
}
<

item := hp.items[idx]
return item
}

// GetAll returns all the items.
func (hp *indexedHeap) GetAll() []TopNItem {
all := make([]TopNItem, len(hp.items))
copy(all, hp.items)
Expand Down

0 comments on commit d1f8b55

Please sign in to comment.