improve(triggerFlag): improve instance health flag
This commit is contained in:
parent
c0a6adc083
commit
5413402869
@ -101,7 +101,7 @@ const I18N_CONF = {
|
||||
columnClusterCount: 'Cluster Count',
|
||||
columnIpCount: 'Instance Count',
|
||||
columnHealthyInstanceCount: 'Healthy Instance Count',
|
||||
columnTriggerFlag: 'Trigger Flag',
|
||||
columnTriggerFlag: 'Trigger Protection Threshold',
|
||||
operation: 'Operation',
|
||||
detail: 'Details',
|
||||
sampleCode: 'Code Example',
|
||||
|
@ -101,7 +101,7 @@ const I18N_CONF = {
|
||||
columnClusterCount: '集群数目',
|
||||
columnIpCount: '实例数',
|
||||
columnHealthyInstanceCount: '健康实例数',
|
||||
columnTriggerFlag: '触发阈值',
|
||||
columnTriggerFlag: '触发保护阈值',
|
||||
operation: '操作',
|
||||
detail: '详情',
|
||||
sampleCode: '示例代码',
|
||||
|
@ -192,15 +192,7 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement
|
||||
}
|
||||
|
||||
public boolean triggerFlag() {
|
||||
if(0 == healthyInstanceCount()) {
|
||||
return true;
|
||||
}
|
||||
Float compareValue = 0.0F;
|
||||
if(Float.floatToIntBits(compareValue) == getProtectThreshold()) {
|
||||
return false;
|
||||
}
|
||||
boolean triggerFlag = (healthyInstanceCount() * 1.0 / allIPs().size()) <= getProtectThreshold();
|
||||
return triggerFlag;
|
||||
return (healthyInstanceCount() * 1.0 / allIPs().size()) <= getProtectThreshold();
|
||||
}
|
||||
|
||||
public void updateIPs(Collection<Instance> instances, boolean ephemeral) {
|
||||
|
Loading…
Reference in New Issue
Block a user