Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public class HostResponse extends BaseResponse {

@SerializedName("memoryallocated")
@Param(description = "the amount of the host's memory currently allocated")
private long memoryAllocated;
private String memoryAllocated;

@SerializedName("memoryused")
@Param(description = "the amount of the host's memory currently used")
Expand Down Expand Up @@ -353,7 +353,7 @@ public void setMemWithOverprovisioning(String memWithOverprovisioning){
this.memWithOverprovisioning=memWithOverprovisioning;
}

public void setMemoryAllocated(long memoryAllocated) {
public void setMemoryAllocated(String memoryAllocated) {
this.memoryAllocated = memoryAllocated;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public HostResponse newHostResponse(HostJoinVO host, EnumSet<HostDetails> detail
hostResponse.setMemoryTotal(host.getTotalMemory());
Float totalMemorywithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
hostResponse.setMemWithOverprovisioning(totalMemorywithOverprovisioning.toString());
hostResponse.setMemoryAllocated(mem);
hostResponse.setMemoryAllocated(decimalFormat.format((float) mem / totalMemorywithOverprovisioning * 100.0f) +"%");

String hostTags = host.getTag();
hostResponse.setHostTags(host.getTag());
Expand Down