Skip to content
Merged
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 @@ -209,7 +209,7 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co
private Long memoryKBs;

@SerializedName("memoryintfreekbs")
@Param(description = "the internal memory thats free in vm")
@Param(description = "the internal memory that's free in vm or zero if it can not be calculated")
private Long memoryIntFreeKBs;

@SerializedName("memorytargetkbs")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,11 @@ public UserVmResponse newUserVmResponse(ResponseView view, String objectName, Us
userVmResponse.setDiskKbsWrite((long)vmStats.getDiskWriteKBs());
userVmResponse.setDiskIORead((long)vmStats.getDiskReadIOs());
userVmResponse.setDiskIOWrite((long)vmStats.getDiskWriteIOs());
userVmResponse.setMemoryKBs((long)vmStats.getMemoryKBs());
userVmResponse.setMemoryIntFreeKBs((long)vmStats.getIntFreeMemoryKBs());
long totalMemory = (long)vmStats.getMemoryKBs();
long freeMemory = (long)vmStats.getIntFreeMemoryKBs();
long correctedFreeMemory = freeMemory >= totalMemory ? 0 : freeMemory;
userVmResponse.setMemoryKBs(totalMemory);
userVmResponse.setMemoryIntFreeKBs(correctedFreeMemory);
userVmResponse.setMemoryTargetKBs((long)vmStats.getTargetMemoryKBs());

}
Expand Down