本文整理了Java中io.cattle.platform.core.model.Instance.getMemoryMb()
方法的一些代码示例,展示了Instance.getMemoryMb()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getMemoryMb()
方法的具体详情如下:
包路径:io.cattle.platform.core.model.Instance
类名称:Instance
方法名:getMemoryMb
[英]Getter for cattle.instance.memory_mb
.
[中]cattle.instance.memory_mb
的Getter。
代码示例来源:origin: rancher/cattle
protected String getInstanceType(Instance instance) {
Long mem = instance.getMemoryMb();
if (mem == null) {
mem = 64L;
}
Long cpu = DataAccessor.fieldLong(instance, InstanceConstants.FIELD_VCPU);
if (cpu == null) {
cpu = 1L;
}
StringBuilder buffer = new StringBuilder();
if (mem < 1024) {
buffer.append(mem).append("mb-");
} else {
buffer.append(mem.floatValue() / 1024).append("gb-");
}
buffer.append(cpu).append("cpu");
return buffer.toString();
}
代码示例来源:origin: rancher/cattle
labels.put(SystemLabels.LABEL_VM, "true");
long mem = 512L;
if (instance.getMemoryMb() == null) {
labels.put(SystemLabels.LABEL_VM_MEMORY, "512");
} else {
mem = instance.getMemoryMb();
labels.put(SystemLabels.LABEL_VM_MEMORY, instance.getMemoryMb().toString());
代码示例来源:origin: rancher/cattle
setAllocationState(from.getAllocationState());
setCompute(from.getCompute());
setMemoryMb(from.getMemoryMb());
setImageId(from.getImageId());
setHostname(from.getHostname());
内容来源于网络,如有侵权,请联系作者删除!