-
Notifications
You must be signed in to change notification settings - Fork 721
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 gc in hot peer cache #8702
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8702 +/- ##
==========================================
+ Coverage 71.70% 71.77% +0.07%
==========================================
Files 517 517
Lines 67450 67477 +27
==========================================
+ Hits 48364 48432 +68
+ Misses 15521 15487 -34
+ Partials 3565 3558 -7
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -115,6 +116,7 @@ func (f *HotPeerCache) UpdateStat(item *HotPeerStat) { | |||
return | |||
} | |||
f.incMetrics(item.actionType, item.StoreID) | |||
f.removeExpiredItems() |
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.
Will it be called every time we receive a region heartbeat?
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.
In previous, removeItem
or putItem
will call tn.maintain()
every time. In this PR, it will call only after topNTTL
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.
L554-L556
@@ -80,7 +80,7 @@ func (w *HotCache) CheckReadAsync(task func(cache *HotPeerCache)) bool { | |||
func (w *HotCache) RegionStats(kind utils.RWType, minHotDegree int) map[uint64][]*HotPeerStat { | |||
ret := make(chan map[uint64][]*HotPeerStat, 1) | |||
collectRegionStatsTask := func(cache *HotPeerCache) { | |||
ret <- cache.RegionStats(minHotDegree) | |||
ret <- cache.PeerStats(minHotDegree) |
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.
Why change the name, it's not consistent with other places.
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.
Okay, I'll keep the TODO and change them in another PR uniform.
/check-issue-triage-complete |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rleungx 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 |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: Close #8698
What is changed and how does it work?
Check List
Tests
Release note