Skip to content

Commit 2cb9747

Browse files
authored
doc: Improve javadoc for DegradeRule and dashboard ApiPredicateItemVo (#2614)
1 parent ab6c9ad commit 2cb9747

File tree

2 files changed

+25
-1
lines changed
  • sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade
  • sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/gateway/api

2 files changed

+25
-1
lines changed

sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/block/degrade/DegradeRule.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ public DegradeRule(String resourceName) {
5959
private int grade = RuleConstant.DEGRADE_GRADE_RT;
6060

6161
/**
62-
* Threshold count.
62+
* Threshold count. The exact meaning depends on the field of grade.
63+
* <ul>
64+
* <li>In average RT mode, it means the maximum response time(RT) in milliseconds.</li>
65+
* <li>In exception ratio mode, it means exception ratio which between 0.0 and 1.0.</li>
66+
* <li>In exception count mode, it means exception count</li>
67+
* <ul/>
6368
*/
6469
private double count;
6570

@@ -78,9 +83,16 @@ public DegradeRule(String resourceName) {
7883

7984
/**
8085
* The threshold of slow request ratio in RT mode.
86+
*
87+
* @since 1.8.0
8188
*/
8289
private double slowRatioThreshold = 1.0d;
8390

91+
/**
92+
* The interval statistics duration in millisecond.
93+
*
94+
* @since 1.8.0
95+
*/
8496
private int statIntervalMs = 1000;
8597

8698
public int getGrade() {

sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/gateway/api/ApiPredicateItemVo.java

+12
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,20 @@
2323
*/
2424
public class ApiPredicateItemVo {
2525

26+
/**
27+
* The pattern for matching url.
28+
*/
2629
private String pattern;
2730

31+
/**
32+
* The matching Strategy in url. Constants are defined in class SentinelGatewayConstants.\
33+
*
34+
* <ul>
35+
* <li>0(URL_MATCH_STRATEGY_EXACT): exact match mode</li>
36+
* <li>1(URL_MATCH_STRATEGY_PREFIX): prefix match mode</li>
37+
* <li>2(URL_MATCH_STRATEGY_REGEX): regex match mode</li>
38+
* </ul>
39+
*/
2840
private Integer matchStrategy;
2941

3042
public String getPattern() {

0 commit comments

Comments
 (0)