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

curvefs/client: get and set counts #2950

Merged
merged 1 commit into from
Dec 9, 2023
Merged

Conversation

shuaihehe
Copy link
Contributor

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

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@shuaihehe
Copy link
Contributor Author

curve01

@shuaihehe
Copy link
Contributor Author

通过以下步骤将指标增加:

  1. 根据client.yaml文件的配置创建文件系统并挂载到目录/root/filesyatem下
  2. 在目录/root/filesyatem下创建test.txt文件
  3. 使用python程序向test.txt文件中不断写入字符串,查看指标变化;停止python程序,使用tail命令查看test.txt文件中的内容,再次查看指标变化,指标变化如下图:
    111
    222

Copy link
Contributor

@Ziy1-Tan Ziy1-Tan left a comment

Choose a reason for hiding this comment

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

No need to open another pr when you make new commits.

@Ziy1-Tan
Copy link
Contributor

Ziy1-Tan commented Dec 8, 2023

cicicheck

@Ziy1-Tan
Copy link
Contributor

Ziy1-Tan commented Dec 8, 2023

cicheck

Copy link
Contributor

@201341 201341 left a comment

Choose a reason for hiding this comment

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

LGTM

@wuhongsong wuhongsong changed the title get and set counts curvefs/client: get and set counts Dec 9, 2023
@wuhongsong wuhongsong merged commit abe27ed into opencurve:master Dec 9, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants