bug修复

develop
yuemian 2024-09-06 19:23:15 +08:00
parent 4f38e65339
commit d0fa323e2b
1 changed files with 17 additions and 14 deletions

View File

@ -25,6 +25,7 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
@ -113,6 +114,7 @@ public class AlistarController {
} }
item.put("instanceUuid", DigestUtils.md5Hex("ALISTAR-" + instance.getInstanceId())); item.put("instanceUuid", DigestUtils.md5Hex("ALISTAR-" + instance.getInstanceId()));
List<AlistarInstanceMetricValue> values = this.getAlistarResourceInstanceMetricValue(instance); List<AlistarInstanceMetricValue> values = this.getAlistarResourceInstanceMetricValue(instance);
if (!CollectionUtils.isEmpty(values)) {
for (AlistarInstanceMetricValue value : values) { for (AlistarInstanceMetricValue value : values) {
if (value.getKey().startsWith("os.memory.") || value.getKey().startsWith("memory.")) { if (value.getKey().startsWith("os.memory.") || value.getKey().startsWith("memory.")) {
BigDecimal valueGB = new BigDecimal(value.getValue()).divide(BigDecimal.valueOf(1024L * 1024L * 1024L), 3, RoundingMode.HALF_UP); BigDecimal valueGB = new BigDecimal(value.getValue()).divide(BigDecimal.valueOf(1024L * 1024L * 1024L), 3, RoundingMode.HALF_UP);
@ -129,6 +131,7 @@ public class AlistarController {
item.put(value.getKey(), value.getValue()); item.put(value.getKey(), value.getValue());
} }
} }
}
list.add(item); list.add(item);
} }
return new GeneralResult<>(true, list, "查询成功"); return new GeneralResult<>(true, list, "查询成功");