-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
statistics: print the process of init stats #53560
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #53560 +/- ##
================================================
+ Coverage 72.4222% 74.7782% +2.3560%
================================================
Files 1505 1507 +2
Lines 430553 439922 +9369
================================================
+ Hits 311816 328966 +17150
+ Misses 99427 90766 -8661
- Partials 19310 20190 +880
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Weizhen Wang <[email protected]>
/retest |
1 similar comment
/retest |
Signed-off-by: Weizhen Wang <[email protected]>
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
@@ -57,6 +101,10 @@ func (ls *RangeWorker) loadStats() { | |||
if err := ls.dealFunc(task); err != nil { | |||
logutil.BgLogger().Error("load stats failed", zap.Error(err)) | |||
} | |||
if ls.logger != nil { | |||
completeTaskCnt := ls.completeTaskCnt.Add(1) | |||
ls.logger.Info(fmt.Sprintf("load %s [%d/%d]", ls.taskName, completeTaskCnt, ls.taskCnt)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems it's sampling output
1% 50% 90% 100%
if 100% is missed, will the log msg look wired as unfinished/hang?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is complete, It must print complete
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
load xxxx [completed task count / total task count]
@winoros @hi-rustin PTAL |
Signed-off-by: Weizhen Wang <[email protected]>
pkg/statistics/handle/bootstrap.go
Outdated
err = h.initStatsHistogramsLite(is, cache) | ||
if err != nil { | ||
return errors.Trace(err) | ||
} | ||
statslogutil.StatsLogger().Info("complete to load the histogram") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
statslogutil.StatsLogger().Info("complete to load the histogram") | |
statslogutil.StatsLogger().Info("complete to load the lite histogram") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
/hold |
@elsa0520 Please confirm one last time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, elsa0520, winoros The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
/retest |
What problem does this PR solve?
Issue Number: close #53564
Problem Summary:
What changed and how does it work?
it sometimes takes too much time for tidb to init stats. we should print the process info to tell the users.
Check List
Tests
if we have several tables, it will print
But if TiDB has enough tables, it will print.
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.