mirror of https://github.com/apache/cloudstack.git
Merge pull request #2075 from shapeblue/metrics-view-deviation-fix
[4.9+] CLOUDSTACK-9900: Fix high CPU deviation issues seen in metrics view
This commit is contained in:
commit
d710b551bc
|
|
@ -128,10 +128,10 @@ public class ClusterMetricsResponse extends ClusterResponse {
|
|||
}
|
||||
}
|
||||
|
||||
public void setCpuMaxDeviation(final Double maxCpuDeviation, final Double totalCpuUsed, final Long totalHosts) {
|
||||
if (maxCpuDeviation != null && totalCpuUsed != null && totalHosts != null && totalHosts != 0) {
|
||||
final Double averageCpuUsage = totalCpuUsed / totalHosts;
|
||||
this.cpuMaxDeviation = String.format("%.2f%%", (maxCpuDeviation - averageCpuUsage) * 100.0 / averageCpuUsage);
|
||||
public void setCpuMaxDeviation(final Double maxCpuUsagePercentage, final Double totalCpuUsedPercentage, final Long totalHosts) {
|
||||
if (maxCpuUsagePercentage != null && totalCpuUsedPercentage != null && totalHosts != null && totalHosts != 0) {
|
||||
final Double averageCpuUsagePercentage = totalCpuUsedPercentage / totalHosts;
|
||||
this.cpuMaxDeviation = String.format("%.2f%%", (maxCpuUsagePercentage - averageCpuUsagePercentage) / averageCpuUsagePercentage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,10 +123,10 @@ public class ZoneMetricsResponse extends ZoneResponse {
|
|||
}
|
||||
}
|
||||
|
||||
public void setCpuMaxDeviation(final Double maxCpuDeviation, final Double totalCpuUsed, final Long totalHosts) {
|
||||
if (maxCpuDeviation != null && totalCpuUsed != null && totalHosts != null && totalHosts != 0) {
|
||||
final Double averageCpuUsage = totalCpuUsed / totalHosts;
|
||||
this.cpuMaxDeviation = String.format("%.2f%%", (maxCpuDeviation - averageCpuUsage) * 100.0 / averageCpuUsage);
|
||||
public void setCpuMaxDeviation(final Double maxCpuUsagePercentage, final Double totalCpuUsedPercentage, final Long totalHosts) {
|
||||
if (maxCpuUsagePercentage != null && totalCpuUsedPercentage != null && totalHosts != null && totalHosts != 0) {
|
||||
final Double averageCpuUsagePercentage = totalCpuUsedPercentage / totalHosts;
|
||||
this.cpuMaxDeviation = String.format("%.2f%%", (maxCpuUsagePercentage - averageCpuUsagePercentage) / averageCpuUsagePercentage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue