Compare commits

..

No commits in common. "0e3e9d1705b882d57e6eaa436fc2a5968a62b89a" and "64c893db87eb1c43f05867af8f61c11db977fa09" have entirely different histories.

1 changed files with 14 additions and 17 deletions

View File

@ -25,7 +25,6 @@ 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;
@ -114,22 +113,20 @@ 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); item.put(value.getKey(), valueGB.toPlainString());
item.put(value.getKey(), valueGB.toPlainString()); } else if (value.getKey().startsWith("capacity.")) {
} else if (value.getKey().startsWith("capacity.")) { BigDecimal valueGB = new BigDecimal(value.getValue()).divide(BigDecimal.valueOf(1024L * 1024L * 1024L * 1024L), 3, RoundingMode.HALF_UP);
BigDecimal valueGB = new BigDecimal(value.getValue()).divide(BigDecimal.valueOf(1024L * 1024L * 1024L * 1024L), 3, RoundingMode.HALF_UP); item.put(value.getKey(), valueGB.toPlainString());
item.put(value.getKey(), valueGB.toPlainString()); } else if (value.getKey().startsWith("net.interface.") ||
} else if (value.getKey().startsWith("net.interface.") || value.getKey().startsWith("os.service.") ||
value.getKey().startsWith("os.service.") || value.getKey().startsWith("os.processor.") ||
value.getKey().startsWith("os.processor.") || value.getKey().startsWith("os.process.")) {
value.getKey().startsWith("os.process.")) { // do nothing
// do nothing } else {
} else { item.put(value.getKey(), value.getValue());
item.put(value.getKey(), value.getValue());
}
} }
} }
list.add(item); list.add(item);