curvefs/client: get and set counts#2950
Merged
wuhongsong merged 1 commit intoopencurve:masterfrom Dec 9, 2023
Merged
Conversation
Contributor
Author
Contributor
Author
Ziy1-Tan
approved these changes
Dec 8, 2023
Contributor
Ziy1-Tan
left a comment
There was a problem hiding this comment.
No need to open another pr when you make new commits.
Contributor
|
cicicheck |
Contributor
|
cicheck |
wuhongsong
approved these changes
Dec 9, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What problem does this PR solve?
Issue Number: #2841
Problem Summary: Get和Set方法会加到线程池,大量Get和Set的情况下线程池里的任务会大量堆积,这里使用bvar变量对线程池里的Get和Set进行计数。
What is changed and how it works?
What's Changed:
client_metric.h:结构体KVClientManagerMetric中增加了两个bvar变量(getQueueSize和setQueueSize)分别用来对Get和Set计数。
kvclient_manager.cpp:在类KVClientManager的Get和Set方法里改变bvar变量的值。
How it Works: 任务加入到线程池,对bvar变量进行+1操作,任务结束,bvar变量及时-1。
Side effects(Breaking backward compatibility? Performance regression?): 无
Check List