opencurve / curve

Curve is a sandbox project hosted by the CNCF Foundation. It's cloud-native, high-performance, and easy to operate. Curve is an open-source distributed storage system for block and shared file storage.
https://opencurve.io
Apache License 2.0
2.33k stars 522 forks source link

get and set counts #2944

Closed shuaihehe closed 10 months ago

shuaihehe commented 11 months ago

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

shuaihehe commented 11 months ago

curve01

shuaihehe commented 11 months ago

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

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

cicheck