-
Notifications
You must be signed in to change notification settings - Fork 147
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
关于线程池监控的一个PR #60
base: master
Are you sure you want to change the base?
关于线程池监控的一个PR #60
Conversation
修改MetricRegistryImpl添加取消所有已注册指标的方法
Codecov Report
@@ Coverage Diff @@
## master #60 +/- ##
============================================
- Coverage 34.51% 34.47% -0.05%
- Complexity 1325 1326 +1
============================================
Files 215 215
Lines 13908 13924 +16
Branches 1135 1135
============================================
- Hits 4801 4800 -1
- Misses 8784 8801 +17
Partials 323 323
Continue to review full report at Codecov.
|
很好的建议,这里面有不少重复的代码,能否尽量把逻辑都统一到这个方法里面: public InstrumentedExecutorService(final ExecutorService delegate, final MetricRegistry registry, final String name, final Map<String, String> metricTags, final MetricLevel metricLevel, final ReservoirType reservoirType) 其他的构造函数都来调用这个函数。 |
好的 我认为线程池监控还有一些额外的参数需要并且可以监控,后续我会调整该PR哈 |
构造函数复用已经修改 同时我认为为了更好的反应线程池负载可以添加以下指标采集【最大线程池数量,核心线程池数量,线程池当前线程数量,线程池当前活跃线程数量,线程池任务队列大小】。在开发过程中大部分的线程池都是基于ThreadPoolExecutor来创建的,应该可以满足大部分的需求 |
线程池指标监控采集的Timer内置的HistogramImpl的Reservoir类型为EXPONENTIALLY_DECAYING
如果强制要求Reservoir类型为EXPONENTIALLY_DECAYING感觉不太合理,因为作为指标采集方来说我可能更加关注的是线程池每分钟处理业务的耗时峰值,最小值,平均值等,所以希望通过重载Timer的构造方法实现由业务方决定Reservoir的类型。并且我希望在采集线程池的时候修改指标级别或者添加一些自定义TAG,所以新加了个重载的构造方法