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: fix refactor #1881

Merged
merged 5 commits into from
Nov 4, 2019
Merged

statistics: fix refactor #1881

merged 5 commits into from
Nov 4, 2019

Conversation

Luffbee
Copy link
Contributor

@Luffbee Luffbee commented Nov 1, 2019

What problem does this PR solve?

The previous refactor PR #1750 accidentally removed the change of calculating region flow in PR #1688.

What is changed and how it works?

Fix it and made some upgrade:
PR #1688 only use the report interval to improve the flow rates.
This PR also use report interval to denoise.

Check List

Tests

  • Unit test

@Luffbee Luffbee added type/enhancement The issue or PR belongs to an enhancement. component/schedule Scheduling logic. labels Nov 1, 2019
@codecov-io
Copy link

codecov-io commented Nov 1, 2019

Codecov Report

Merging #1881 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1881      +/-   ##
==========================================
- Coverage   77.89%   77.84%   -0.05%     
==========================================
  Files         161      161              
  Lines       16070    16069       -1     
==========================================
- Hits        12517    12509       -8     
- Misses       2557     2558       +1     
- Partials      996     1002       +6
Impacted Files Coverage Δ
server/statistics/hot_peer_cache.go 89.24% <100%> (-0.07%) ⬇️
pkg/metricutil/metricutil.go 90.62% <0%> (-9.38%) ⬇️
server/region_syncer/client.go 77.63% <0%> (-7.9%) ⬇️
pkg/etcdutil/etcdutil.go 82.6% <0%> (-5.8%) ⬇️
server/schedulers/shuffle_hot_region.go 56.17% <0%> (-5.62%) ⬇️
server/schedulers/random_merge.go 58.13% <0%> (-4.66%) ⬇️
server/member/leader.go 76.53% <0%> (-3.07%) ⬇️
server/grpc_service.go 57.32% <0%> (-0.65%) ⬇️
server/handler.go 53.82% <0%> (-0.5%) ⬇️
client/client.go 68.6% <0%> (-0.44%) ⬇️
... and 5 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 ba01076...cc5323e. Read the comment docs.

if interval < hotRegionReportMinInterval && !isExpired {
if oldItem != nil && !isExpired {
// ignore if report too fast or an old report
isOldReport := endTime.After(oldItem.LastUpdateTime)
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little bit confused about the meaning of isOldReport, does it mean the report time is before the LastUpdateTime?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, my mistake. Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, do we need to add a test to avoid similar problem

Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

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

LGTM

@Luffbee Luffbee added the status/can-merge Indicates a PR has been approved by a committer. label Nov 4, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 4, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Nov 4, 2019

@Luffbee merge failed.

@Luffbee
Copy link
Contributor Author

Luffbee commented Nov 4, 2019

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Nov 4, 2019

Your auto merge job has been accepted, waiting for 1878

@sre-bot
Copy link
Contributor

sre-bot commented Nov 4, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Nov 4, 2019

@Luffbee merge failed.

@Luffbee
Copy link
Contributor Author

Luffbee commented Nov 4, 2019

/rebuild

@Luffbee
Copy link
Contributor Author

Luffbee commented Nov 4, 2019

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Nov 4, 2019

/run-all-tests

@sre-bot sre-bot merged commit 5a35c66 into tikv:master Nov 4, 2019
@Luffbee Luffbee deleted the fix-refactor branch November 4, 2019 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/schedule Scheduling logic. status/can-merge Indicates a PR has been approved by a committer. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants