Allon Mureinik has posted comments on this change.
Change subject: core:Use proper percentage calculation for storage.
......................................................................
Patch Set 2: Looks good to me, approved
(1 inline comment)
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageDomainDynamic.java
Line 67: public double getfreeDiskPercent() {
Line 68: int usedDiskSize = getused_disk_size() == null ? 0 :
getused_disk_size();
Line 69: int availableDiskSize = getavailable_disk_size() == null ? 0 :
getavailable_disk_size();
Line 70: double totalSize = usedDiskSize + availableDiskSize;
Line 71: return totalSize != 0 ? (availableDiskSize / totalSize) * 100
: 0;
nickpicking - if you use 0.0 instead of 0, you'll save the promotion from int
to double.
Line 72: }
Line 73:
Line 74: public int getfreeDiskInGB() {
Line 75: int availableDiskSize = getavailable_disk_size() == null ?
0 : getavailable_disk_size();
--
To view, visit http://gerrit.ovirt.org/11404
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic9c03538a4c6173bd8eb5c0f35f665659afcff2d
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches