-
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
stats: reduce stats collecor's lock contention #9233
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9233 +/- ##
=========================================
- Coverage 67.3% 67.3% -0.01%
=========================================
Files 373 373
Lines 78449 78441 -8
=========================================
- Hits 52803 52795 -8
+ Misses 20911 20910 -1
- Partials 4735 4736 +1
Continue to review full report at Codecov.
|
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
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
/run-all-tests |
What problem does this PR solve?
We will create a session stats collector for each session and link them into a list. So when there are many sessions, it will take longer to loop the list, and holding the list head's lock during the whole process will block other operations, like
NewSessionStatsCollector
.What is changed and how it works?
When looping the list, only holds the lock of necessary stats collector, that is the previous one and current. So it will only holds at most two locks at the same time.
Check List
Tests
Code changes
Side effects
Related changes