forked from LianjiaTech/retrofit-spring-boot-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f804b10
commit e3f597a
Showing
18 changed files
with
250 additions
and
404 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,25 @@ | |
import java.lang.annotation.*; | ||
|
||
/** | ||
* 应仅采用异常比例模式来控制熔断,超时导致的报错应在okhttp这一层做 | ||
* @author 陈添明 [email protected] | ||
* @author 陈添明 | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD, ElementType.TYPE}) | ||
@Documented | ||
public @interface Degrade { | ||
|
||
/** | ||
* 异常比例 | ||
* RT threshold or exception ratio threshold count. | ||
*/ | ||
float count(); | ||
double count(); | ||
|
||
/** | ||
* 时间窗口size,单位:秒 | ||
* Degrade recover timeout (in seconds) when degradation occurs. | ||
*/ | ||
int timeWindow() default 5; | ||
|
||
/** | ||
* Degrade strategy (0: average RT, 1: exception ratio). | ||
*/ | ||
DegradeStrategy degradeStrategy() default DegradeStrategy.AVERAGE_RT; | ||
} |
32 changes: 0 additions & 32 deletions
32
src/main/java/com/github/lianjiatech/retrofit/spring/boot/degrade/DegradeRuleRegister.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.