mirror of https://github.com/apache/cloudstack.git
Revert "FIX3: Consider overcommit ratios with total/threshold values"
This reverts commit 9c82452b82.
This commit is contained in:
parent
3caef4487e
commit
fe88eecfd6
|
|
@ -174,13 +174,13 @@ public class ClusterMetricsResponse extends ClusterResponse {
|
|||
|
||||
public void setCpuAllocatedThreshold(final Long cpuAllocated, final Long cpuUsed, final Double overCommitRatio, final Double threshold) {
|
||||
if (cpuAllocated != null && cpuUsed != null && overCommitRatio != null && threshold != null && cpuUsed != 0) {
|
||||
this.cpuAllocatedThresholdExceeded = (1.0 * cpuAllocated / cpuUsed) > (threshold * overCommitRatio);
|
||||
this.cpuAllocatedThresholdExceeded = (1.0 * cpuAllocated * overCommitRatio / cpuUsed) > threshold;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCpuAllocatedDisableThreshold(final Long cpuAllocated, final Long cpuUsed, final Double overCommitRatio, final Float threshold) {
|
||||
if (cpuAllocated != null && cpuUsed != null && overCommitRatio != null && threshold != null && cpuUsed != 0) {
|
||||
this.cpuAllocatedDisableThresholdExceeded = (1.0 * cpuAllocated / cpuUsed) > (threshold * overCommitRatio);
|
||||
this.cpuAllocatedDisableThresholdExceeded = (1.0 * cpuAllocated * overCommitRatio / cpuUsed) > threshold;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -199,13 +199,13 @@ public class ClusterMetricsResponse extends ClusterResponse {
|
|||
|
||||
public void setMemoryAllocatedThreshold(final Long memAllocated, final Long memTotal, final Double overCommitRatio, final Double threshold) {
|
||||
if (memAllocated != null && memTotal != null && overCommitRatio != null && threshold != null && memTotal != 0) {
|
||||
this.memoryAllocatedThresholdExceeded = (1.0 * memAllocated / memTotal) > (threshold * overCommitRatio);
|
||||
this.memoryAllocatedThresholdExceeded = (1.0 * memAllocated * overCommitRatio / memTotal) > threshold;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMemoryAllocatedDisableThreshold(final Long memAllocated, final Long memTotal, final Double overCommitRatio, final Float threshold) {
|
||||
if (memAllocated != null && memTotal != null && overCommitRatio != null && threshold != null && memTotal != 0) {
|
||||
this.memoryAllocatedDisableThresholdExceeded = (1.0 * memAllocated / memTotal) > (threshold * overCommitRatio);
|
||||
this.memoryAllocatedDisableThresholdExceeded = (1.0 * memAllocated * overCommitRatio / memTotal) > threshold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,13 +167,13 @@ public class HostMetricsResponse extends HostResponse {
|
|||
|
||||
public void setCpuAllocatedThreshold(final String cpuAllocated, final Double overCommitRatio, final Double threshold) {
|
||||
if (cpuAllocated != null && overCommitRatio != null && threshold != null) {
|
||||
this.cpuAllocatedThresholdExceeded = Double.valueOf(cpuAllocated.replace("%", "")) > (100.0 * threshold * overCommitRatio);
|
||||
this.cpuAllocatedThresholdExceeded = (Double.valueOf(cpuAllocated.replace("%", "")) * overCommitRatio) > (100.0 * threshold);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCpuAllocatedDisableThreshold(final String cpuAllocated, final Double overCommitRatio, final Float threshold) {
|
||||
if (cpuAllocated != null && overCommitRatio != null && threshold != null) {
|
||||
this.cpuAllocatedDisableThresholdExceeded = Double.valueOf(cpuAllocated.replace("%", "")) > (100.0 * threshold * overCommitRatio);
|
||||
this.cpuAllocatedDisableThresholdExceeded = (Double.valueOf(cpuAllocated.replace("%", "")) * overCommitRatio) > (100.0 * threshold);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -191,13 +191,13 @@ public class HostMetricsResponse extends HostResponse {
|
|||
|
||||
public void setMemoryAllocatedThreshold(final Long memAllocated, final Long memTotal, final Double overCommitRatio, final Double threshold) {
|
||||
if (memAllocated != null && memTotal != null && overCommitRatio != null && threshold != null) {
|
||||
this.memoryAllocatedThresholdExceeded = memAllocated > (memTotal * threshold * overCommitRatio);
|
||||
this.memoryAllocatedThresholdExceeded = (memAllocated * overCommitRatio) > (memTotal * threshold);
|
||||
}
|
||||
}
|
||||
|
||||
public void setMemoryAllocatedDisableThreshold(final Long memAllocated, final Long memTotal, final Double overCommitRatio, final Float threshold) {
|
||||
if (memAllocated != null && memTotal != null && overCommitRatio != null && threshold != null) {
|
||||
this.memoryAllocatedDisableThresholdExceeded = memAllocated > (memTotal * threshold * overCommitRatio);
|
||||
this.memoryAllocatedDisableThresholdExceeded = (memAllocated * overCommitRatio) > (memTotal * threshold);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue