Commit ae039e1f authored by lichenchong's avatar lichenchong
Browse files

Kinetic Simulator:

Modify portionFull in Capacity from remaining capacity percentage to
used capacity percentage. At the same time, update the web page showing
info.
parent fceddc23
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -526,9 +526,9 @@ function showNodeInfo(node) {
}

function renderCapacity(nodeInfo) {
	var remaining = nodeInfo.capacity.portionFull * nodeInfo.capacity.nominalCapacityInBytes;
    var used = nodeInfo.capacity.nominalCapacityInBytes - remaining;
    var freePercentage = nodeInfo.capacity.portionFull;
    var used = nodeInfo.capacity.portionFull * nodeInfo.capacity.nominalCapacityInBytes;
    var remaining = nodeInfo.capacity.nominalCapacityInBytes - used;
    var freePercentage = 1 - nodeInfo.capacity.portionFull;
	
    if ($('#capacity').length > 0) {
        $.getScript('https://www.google.com/jsapi', function (data, textStatus) {
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public abstract class CapacityUtil {

            float remaining = (float) file.getFreeSpace();
            
            float portionFull = (remaining/total);
            float portionFull = (total - remaining)/total;

            capacity = Capacity.newBuilder().setNominalCapacityInBytes(total)
                    .setPortionFull(portionFull).build();