-
Notifications
You must be signed in to change notification settings - Fork 172
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
53e844d
commit a1648ef
Showing
47 changed files
with
518 additions
and
241 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
# 离群实例摘除插件配置 | ||
removal.config: | ||
expireTimes: 60000 # 实例调用信息过期时间。单位:毫秒 | ||
expireTime: 60000 # 实例调用信息过期时间。单位:毫秒 | ||
exceptions: # 任务服务调用失败的异常情况 | ||
- com.alibaba.dubbo.remoting.TimeoutException | ||
- org.apache.dubbo.remoting.TimeoutException | ||
- java.util.concurrent.TimeoutException | ||
- java.net.SocketTimeoutException | ||
enableRemoval: false # 离群实例摘除开关 | ||
recoveryTimes: 30000 # 实例摘除之后的恢复时间 | ||
windowsTimes: 1000 # 离群实例异常统计窗口大小。单位:毫秒 | ||
recoveryTime: 30000 # 实例摘除之后的恢复时间 | ||
windowsTime: 1000 # 离群实例异常统计窗口大小。单位:毫秒 | ||
windowsNum: 10 # 离群实例异常统计窗口个数 | ||
rules: # 离群实例摘除规则,scaleUpLimit:离群实例摘除上限比例。minInstanceNum:最小实例数。 | ||
- { scaleUpLimit: 0.6, minInstanceNum: 1, errorRate: 0.6 } | ||
- { key: default-rule, scaleUpLimit: 0.6, minInstanceNum: 1, errorRate: 0.6 } |
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
58 changes: 58 additions & 0 deletions
58
...removal/removal-plugin/src/main/java/com/huaweicloud/sermant/common/RemovalConstants.java
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.huaweicloud.sermant.common; | ||
|
||
/** | ||
* 常量类 | ||
* | ||
* @author zhp | ||
* @since 2023-04-04 | ||
*/ | ||
public class RemovalConstants { | ||
/** | ||
* Dubbo服务名称KEY | ||
*/ | ||
public static final String APPLICATION_KEY = "application"; | ||
|
||
/** | ||
* 连接符 | ||
*/ | ||
public static final String CONNECTOR = ":"; | ||
|
||
/** | ||
* 时间窗口大小 | ||
*/ | ||
public static final int WINDOWS_TIME = 1000; | ||
|
||
/** | ||
* 窗口个数 | ||
*/ | ||
public static final int WINDOWS_NUM = 10; | ||
|
||
/** | ||
* 插件名称 | ||
*/ | ||
public static final String PLUGIN_NAME = "serment-service-removal"; | ||
|
||
/** | ||
* 动态配置KEY | ||
*/ | ||
public static final String DYNAMIC_CONFIG_KEY = "sermant.removal.config"; | ||
|
||
private RemovalConstants() { | ||
} | ||
} |
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 |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
*/ | ||
public class RemovalRule { | ||
/** | ||
* 服务名称或者接口名称 | ||
* 服务名称 | ||
*/ | ||
private String key; | ||
|
||
|
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
Oops, something went wrong.