-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Make the default max RT value TIME_DROP_VALVE configurable #292
Make the default max RT value TIME_DROP_VALVE configurable #292
Conversation
Codecov Report
@@ Coverage Diff @@
## master #292 +/- ##
============================================
+ Coverage 38.25% 45.85% +7.59%
+ Complexity 937 921 -16
============================================
Files 218 181 -37
Lines 6966 5749 -1217
Branches 948 829 -119
============================================
- Hits 2665 2636 -29
+ Misses 3964 2780 -1184
+ Partials 337 333 -4
Continue to review full report at Codecov.
|
42b48ce
to
d339049
Compare
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
Cool! Thanks for contributing! |
Describe what this PR does / why we need it
根据应用实际RT情况以及监控数据准确性需求,让MAX RT(即TIME_DROP_VALUE)可配置。
Does this pull request fix one issue?
Fixes #276
Describe how you did it
在SentinelConfig中增加了1个参数配置项csp.sentinel.statistic.max.rt,增加默认值和读取方法
Describe how to verify it
add unit test
Special notes for reviews
1.把CHARSET、COLD_FACTOR的默认值也修改为用常量定义(感觉这样看着一致些);
2.读取某个特定参数值方法catch里RecordLog.info改为了warn(因为在catch里打印);
3.cold_factor之前在ColdFactorProperty类读取的,因为默认值在SentinelConfig定义,
改为了用SentinelConfig.coldFactor()读取,其中:
if (coldFactor <= 1) {
coldFactor = 3;
RecordLog.info("cold factor should be larger than 3");
}
判断的是<=1,打印的却是大于3,信息不一致;
这段放到了SentinelConfig.coldFactor()方法里,
判断<=1没变,把信息内容改了下;
4.Constants中的TIME_DROP_VALVE,final修饰去掉了
跟下面那个ON开关一样,便于运行时可以修改,比如以后考虑通过CommandHandler方式。