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: use []float64 to represent hot peer loads #3591

Merged
merged 12 commits into from
Apr 28, 2021

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Apr 14, 2021

What problem does this PR solve?

Currently, all hot peer loads are saved in different variables and accessed using different functions.
Too many duplicated code and hard to extend.

What is changed and how it works?

Save loads using []float64 and access them using enums.

Check List

Tests

  • Unit test

Release note

  • No release note

Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
@lhy1024 lhy1024 added type/refactor The issue belongs to a refactor work. component/statistics Statistics for scheduling. component/scheduler Scheduler logic. labels Apr 14, 2021
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
@codecov
Copy link

codecov bot commented Apr 23, 2021

Codecov Report

Merging #3591 (9e5f8b9) into master (b07be86) will increase coverage by 0.17%.
The diff coverage is 85.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3591      +/-   ##
==========================================
+ Coverage   74.52%   74.70%   +0.17%     
==========================================
  Files         245      245              
  Lines       24155    24195      +40     
==========================================
+ Hits        18002    18075      +73     
+ Misses       4527     4515      -12     
+ Partials     1626     1605      -21     
Flag Coverage Δ
unittests 74.70% <85.59%> (+0.17%) ⬆️

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

Impacted Files Coverage Δ
server/statistics/kind.go 0.00% <0.00%> (ø)
server/cluster/coordinator.go 73.57% <42.85%> (-0.72%) ⬇️
server/api/trend.go 66.19% <50.00%> (ø)
server/schedulers/shuffle_hot_region.go 54.73% <50.00%> (ø)
server/statistics/flowkind.go 83.33% <83.33%> (ø)
server/schedulers/hot_region.go 81.10% <86.66%> (+0.12%) ⬆️
server/schedulers/utils.go 93.63% <100.00%> (+0.52%) ⬆️
server/statistics/hot_peer.go 100.00% <100.00%> (ø)
server/statistics/hot_peer_cache.go 94.14% <100.00%> (+0.96%) ⬆️
server/schedulers/hot_region_config.go 78.72% <0.00%> (-3.20%) ⬇️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b07be86...9e5f8b9. Read the comment docs.

Copy link
Contributor

@Yisaer Yisaer left a comment

Choose a reason for hiding this comment

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

Rest LGTM

server/cluster/coordinator.go Outdated Show resolved Hide resolved
Signed-off-by: lhy1024 <admin@liudos.us>
@lhy1024
Copy link
Contributor Author

lhy1024 commented Apr 28, 2021

@Yisaer @rleungx PTAL

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 28, 2021
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Yisaer
  • rleungx

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 28, 2021
@lhy1024
Copy link
Contributor Author

lhy1024 commented Apr 28, 2021

/merge

@ti-chi-bot
Copy link
Member

@lhy1024: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: a850c8b

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 28, 2021
@ti-chi-bot
Copy link
Member

@lhy1024: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@sonarcloud
Copy link

sonarcloud bot commented Apr 28, 2021

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

No Coverage information No Coverage information
7.2% 7.2% Duplication

@ti-chi-bot ti-chi-bot merged commit 043a1cb into tikv:master Apr 28, 2021
@lhy1024 lhy1024 deleted the re-hot branch June 2, 2021 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/scheduler Scheduler logic. component/statistics Statistics for scheduling. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/refactor The issue belongs to a refactor work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants