Skip to content

Commit

Permalink
resourcemanger: create cpu/memory monitor
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed Dec 15, 2022
1 parent 23a14d1 commit 760618b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1940,8 +1940,10 @@ func (do *Domain) loadStatsWorker() {
lease = 3 * time.Second
}
loadTicker := time.NewTicker(lease)
updStatsHealthyTicker := time.NewTicker(20 * lease)
defer func() {
loadTicker.Stop()
updStatsHealthyTicker.Stop()
logutil.BgLogger().Info("loadStatsWorker exited.")
}()
statsHandle := do.StatsHandle()
Expand All @@ -1967,6 +1969,8 @@ func (do *Domain) loadStatsWorker() {
if err != nil {
logutil.BgLogger().Debug("load histograms failed", zap.Error(err))
}
case <-updStatsHealthyTicker.C:
statsHandle.UpdateStatsHealthyMetrics()
case <-do.exit:
return
}
Expand Down

0 comments on commit 760618b

Please sign in to comment.