Skip to content

Commit

Permalink
This is an automated cherry-pick of #55386
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
hawkingrei authored and ti-chi-bot committed Sep 25, 2024
1 parent 116ffee commit a0c00f8
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1955,10 +1955,8 @@ 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.")
}()
do.initStats()
Expand All @@ -1979,8 +1977,6 @@ 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 Expand Up @@ -2046,15 +2042,25 @@ func (do *Domain) updateStatsWorker(ctx sessionctx.Context, owner owner.Manager)
loadFeedbackTicker := time.NewTicker(5 * lease)
loadLockedTablesTicker := time.NewTicker(5 * lease)
dumpColStatsUsageTicker := time.NewTicker(100 * lease)
<<<<<<< HEAD:domain/domain.go
readMemTricker := time.NewTicker(memory.ReadMemInterval)
=======
updateStatsHealthyTicker := time.NewTicker(20 * lease)
readMemTicker := time.NewTicker(memory.ReadMemInterval)
>>>>>>> 0d5e0e921f6 (domain: move UpdateStatsHealthyMetrics into updateStatsWorker (#55386)):pkg/domain/domain.go
statsHandle := do.StatsHandle()
defer func() {
dumpColStatsUsageTicker.Stop()
loadFeedbackTicker.Stop()
dumpFeedbackTicker.Stop()
gcStatsTicker.Stop()
deltaUpdateTicker.Stop()
<<<<<<< HEAD:domain/domain.go
readMemTricker.Stop()
=======
readMemTicker.Stop()
updateStatsHealthyTicker.Stop()
>>>>>>> 0d5e0e921f6 (domain: move UpdateStatsHealthyMetrics into updateStatsWorker (#55386)):pkg/domain/domain.go
do.SetStatsUpdating(false)
logutil.BgLogger().Info("updateStatsWorker exited.")
}()
Expand Down Expand Up @@ -2102,9 +2108,15 @@ func (do *Domain) updateStatsWorker(ctx sessionctx.Context, owner owner.Manager)
if err != nil {
logutil.BgLogger().Debug("dump column stats usage failed", zap.Error(err))
}
<<<<<<< HEAD:domain/domain.go

case <-readMemTricker.C:
=======
case <-readMemTicker.C:
>>>>>>> 0d5e0e921f6 (domain: move UpdateStatsHealthyMetrics into updateStatsWorker (#55386)):pkg/domain/domain.go
memory.ForceReadMemStats()
case <-updateStatsHealthyTicker.C:
statsHandle.UpdateStatsHealthyMetrics()
}
}
}
Expand Down

0 comments on commit a0c00f8

Please sign in to comment.