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

对线程池里的Get和Set进行计数 #2941

Closed
wants to merge 0 commits into from

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

@Ziy1-Tan Ziy1-Tan self-requested a review December 3, 2023 02:41
@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文件中不断写入字符串,最终使用tail命令查看test.txt文件中的内容
  4. 并行度不够,数据无法积累,暂时将数据减一操作注释,数据指标增加。
    curve02

@Ziy1-Tan
Copy link
Contributor

Ziy1-Tan commented Dec 4, 2023

cicheck

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.

None yet

2 participants