|
@@ -221,7 +221,7 @@ public class TaskService {
|
|
|
|
|
|
Integer ecsCount = countMap.get(mqQueueConfig.getQueueName());
|
|
Integer ecsCount = countMap.get(mqQueueConfig.getQueueName());
|
|
MqMsg mqMsg = mqMsgMap.get(mqQueueConfig.getQueueName());
|
|
MqMsg mqMsg = mqMsgMap.get(mqQueueConfig.getQueueName());
|
|
- Boolean flag = mqQueueConfig.getOpenScalingTime() == 0 || checkOpenCount % mqQueueConfig.getOpenScalingTime() == 0;
|
|
|
|
|
|
+ Boolean flag = mqQueueConfig.getOpenScalingTime() == 0 || checkOpenCount / 2 % mqQueueConfig.getOpenScalingTime() == 0;
|
|
//未在计算的服务器数量
|
|
//未在计算的服务器数量
|
|
Integer noModelingCount = mqMsg.getConsumers() - mqMsg.getMessages_unacknowledged();
|
|
Integer noModelingCount = mqMsg.getConsumers() - mqMsg.getMessages_unacknowledged();
|
|
//未启动的服务器数量
|
|
//未启动的服务器数量
|
|
@@ -305,7 +305,6 @@ public class TaskService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 关闭弹性伸缩
|
|
* 关闭弹性伸缩
|
|
*/
|
|
*/
|
|
@@ -324,6 +323,7 @@ public class TaskService {
|
|
|
|
|
|
String modelingKey = String.format(RedisKey.modelingKey,take.getMqEcs().getEcsName());
|
|
String modelingKey = String.format(RedisKey.modelingKey,take.getMqEcs().getEcsName());
|
|
if(redisUtil.hasKey(modelingKey)){
|
|
if(redisUtil.hasKey(modelingKey)){
|
|
|
|
+ log.info("delEcsList--有场景正在计算中:{},{}",modelingKey,redisUtil.get(modelingKey));
|
|
redisUtil.del(stopKey);
|
|
redisUtil.del(stopKey);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -341,10 +341,6 @@ public class TaskService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
public synchronized Boolean createEcs(MqScalingConfig mqScaling){
|
|
public synchronized Boolean createEcs(MqScalingConfig mqScaling){
|
|
try {
|
|
try {
|
|
return ECSUtils.createEcs(mqScaling.getAccessKey(),mqScaling.getSecret(),mqScaling.getEndpoint(),mqScaling.getScalingRuleAri());
|
|
return ECSUtils.createEcs(mqScaling.getAccessKey(),mqScaling.getSecret(),mqScaling.getEndpoint(),mqScaling.getScalingRuleAri());
|
|
@@ -364,6 +360,4 @@ public class TaskService {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|