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

statistics: add an analysis job factory #56073

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

Rustin170506
Copy link
Member

@Rustin170506 Rustin170506 commented Sep 13, 2024

What problem does this PR solve?

Issue Number: ref #55906

Problem Summary:

What changed and how does it work?

An analysis job factory was added to create different analysis jobs. This would help use to reuse code when we implement the new priority queue.

  1. The job-related code has been moved to the job factory.
  2. The corresponding test has been relocated to the job factory tests.
  3. Additional tests have been added for the auto-analyze window.

Check out https://github.com/pingcap/tidb/pull/55889/files#r1758531218 to see how I used it in my new PR.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 13, 2024
Copy link

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 93.27731% with 16 lines in your changes missing coverage. Please review.

Project coverage is 56.1252%. Comparing base (3688a2b) to head (26677c1).
Report is 3 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #56073         +/-   ##
=================================================
- Coverage   72.8981%   56.1252%   -16.7729%     
=================================================
  Files          1609       1760        +151     
  Lines        447275     637736     +190461     
=================================================
+ Hits         326055     357931      +31876     
- Misses       101140     255024     +153884     
- Partials      20080      24781       +4701     
Flag Coverage Δ
integration 38.4777% <0.0000%> (?)
unit 72.0609% <93.2773%> (+0.0489%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9567% <ø> (ø)
parser ∅ <ø> (∅)
br 52.9392% <ø> (+7.1506%) ⬆️

Copy link
Member Author

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔢 Self-check (PR reviewed by myself and ready for feedback.)

@Rustin170506 Rustin170506 changed the title statistics: add analysis job factory statistics: add an analysis job factory Sep 13, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 13, 2024
@Rustin170506
Copy link
Member Author

/retest

Copy link

ti-chi-bot bot commented Sep 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 14, 2024
Copy link

ti-chi-bot bot commented Sep 14, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-13 09:38:08.580354445 +0000 UTC m=+608358.320778383: ☑️ agreed by AilinKid.
  • 2024-09-14 07:54:35.715685573 +0000 UTC m=+688545.456109513: ☑️ agreed by winoros.

Signed-off-by: Rustin170506 <[email protected]>

refacor: move to priorityqueue_test

Signed-off-by: Rustin170506 <[email protected]>

refactor: better time window

Signed-off-by: Rustin170506 <[email protected]>

refactor: better parition name and id

Signed-off-by: Rustin170506 <[email protected]>

docs: add comments back

Signed-off-by: Rustin170506 <[email protected]>

docs: add comments back

Signed-off-by: Rustin170506 <[email protected]>

docs: add comments back

Signed-off-by: Rustin170506 <[email protected]>

tests: add more cases

Signed-off-by: Rustin170506 <[email protected]>

refactor: make lint happy

Signed-off-by: Rustin170506 <[email protected]>

docs: mark it is not thread safe

Signed-off-by: Rustin170506 <[email protected]>

refactor: rename

Signed-off-by: Rustin170506 <[email protected]>

fix

Signed-off-by: Rustin170506 <[email protected]>
@Rustin170506
Copy link
Member Author

Conflicts resolved and rebased on the master branch.

Signed-off-by: Rustin170506 <[email protected]>
@Rustin170506
Copy link
Member Author

/retest

1 similar comment
@Rustin170506
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 5709ba4 into pingcap:master Sep 14, 2024
23 of 24 checks passed
@Rustin170506 Rustin170506 deleted the rustin-patch-job-factory branch September 14, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants