-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
degist-concurrency-bugfix #12223
degist-concurrency-bugfix #12223
Conversation
73b5bde
to
1f68243
Compare
Codecov Report
@@ Coverage Diff @@
## 3.2 #12223 +/- ##
============================================
+ Coverage 68.82% 69.40% +0.58%
+ Complexity 115 2 -113
============================================
Files 3559 1605 -1954
Lines 163607 66165 -97442
Branches 26766 9698 -17068
============================================
- Hits 112597 45922 -66675
+ Misses 41209 15815 -25394
+ Partials 9801 4428 -5373 see 1986 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
...s/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/aggregate/DubboMergingDigest.java
Outdated
Show resolved
Hide resolved
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.
Is it possible to add some uts to verify it?
...dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/aggregate/DubboAbstractTDigest.java
Show resolved
Hide resolved
@songxiaosheng PTAL |
是否可以考虑比micrometer的滑动窗口函数,来实现相同的功能 Micrometer提供了一个名为SlidingWindow的滑动窗口实现,可以用来统计一段时间内的度量指标数据。该实现可以通过以下方式创建: java 这里创建了一个10秒的滑动窗口。可以使用record方法向滑动窗口中添加度量指标数据,例如: java 这里创建了一个名为my.counter的计数器,并将其记录到滑动窗口中。可以使用stream方法获取滑动窗口中的度量指标数据,例如: java 这里获取了滑动窗口中所有度量指标数据的值,并将其存储在一个List中。可以根据需要对这些数据进行进一步处理,例如计算平均值、最大值、最小值等等。 |
支持,我们可以在这个 PR 修复完以后尝试基于 micrometer 进行重构 |
Kudos, SonarCloud Quality Gate passed! |
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
This reverts commit 8b65828.
What is the purpose of the change
Issue Number: close #12153
Brief changelog
The MergingDigest data structure of the t-Digest package uses a cache with a default size (1050) to improve efficiency, and the cache increments by +1 each time it is added.
If the cache is full, the space will be merged and tempUsed=0 will be reset. In this process, there are common concurrency problems in the judgment and merge methods, which need to be fixed.
Verifying this change
see testcase testMulti, also as follow:
1、git pull 3.2
2、modify the ConsumerApplication code of dubbo-demo-spring-boot-consumer as follows. About 0.1% error rate before the change, no error rate after the change