Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domain: move UpdateStatsHealthyMetrics into updateStatsWorker (#55386) #56324

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2259,10 +2259,8 @@
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 @@ -2283,8 +2281,6 @@
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 @@ -2371,15 +2367,17 @@
loadFeedbackTicker := time.NewTicker(5 * lease)
loadLockedTablesTicker := time.NewTicker(5 * lease)
dumpColStatsUsageTicker := time.NewTicker(100 * lease)
readMemTricker := time.NewTicker(memory.ReadMemInterval)
updateStatsHealthyTicker := time.NewTicker(20 * lease)
readMemTicker := time.NewTicker(memory.ReadMemInterval)
statsHandle := do.StatsHandle()
defer func() {
dumpColStatsUsageTicker.Stop()
loadFeedbackTicker.Stop()
dumpFeedbackTicker.Stop()
gcStatsTicker.Stop()
deltaUpdateTicker.Stop()
readMemTricker.Stop()
readMemTicker.Stop()
updateStatsHealthyTicker.Stop()
do.SetStatsUpdating(false)
logutil.BgLogger().Info("updateStatsWorker exited.")
}()
Expand Down Expand Up @@ -2428,9 +2426,10 @@
if err != nil {
logutil.BgLogger().Debug("dump column stats usage failed", zap.Error(err))
}

case <-readMemTricker.C:
case <-readMemTicker.C:
memory.ForceReadMemStats()
case <-updateStatsHealthyTicker.C:
statsHandle.UpdateStatsHealthyMetrics()

Check warning on line 2432 in domain/domain.go

View check run for this annotation

Codecov / codecov/patch

domain/domain.go#L2431-L2432

Added lines #L2431 - L2432 were not covered by tests
}
}
}
Expand Down