improve(triggerFlag): improve instance health flag

This commit is contained in:
universefeeler 2019-09-19 20:03:09 +08:00
parent c0a6adc083
commit 5413402869
3 changed files with 3 additions and 11 deletions

View File

@ -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',

View File

@ -101,7 +101,7 @@ const I18N_CONF = {
columnClusterCount: '集群数目',
columnIpCount: '实例数',
columnHealthyInstanceCount: '健康实例数',
columnTriggerFlag: '触发阈值',
columnTriggerFlag: '触发保护阈值',
operation: '操作',
detail: '详情',
sampleCode: '示例代码',

View File

@ -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) {