Make the default max RT value TIME_DROP_VALVE configurable - #292
Merged
sczyh30 merged 1 commit intoDec 29, 2018
Merged
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.
|
cdfive
force-pushed
the
enhancement/time-drop-value-configurable
branch
from
December 25, 2018 05:48
42b48ce to
d339049
Compare
Member
|
Cool! Thanks for contributing! |
Arlmls
pushed a commit
to Arlmls/Sentinel
that referenced
this pull request
Jan 8, 2019
CST11021
pushed a commit
to CST11021/Sentinel
that referenced
this pull request
Nov 3, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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方式。