Skip to content

Commit 16ec9ae

Browse files
committed
Show drs imbalance as percentage
1 parent e90eae9 commit 16ec9ae

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ public List<ClusterMetricsResponse> listClusterMetrics(Pair<List<ClusterResponse
789789

790790
try {
791791
Double imbalance = ClusterDrsAlgorithm.getClusterImbalance(clusterId, cpuList, memoryList, null);
792-
metricsResponse.setDrsImbalance(imbalance.isNaN() ? null : String.format("%.2f%%", imbalance));
792+
metricsResponse.setDrsImbalance(imbalance.isNaN() ? null : 100.0 * imbalance);
793793
} catch (ConfigurationException e) {
794794
LOGGER.warn("Failed to get cluster imbalance for cluster " + clusterId, e);
795795
}

plugins/metrics/src/main/java/org/apache/cloudstack/response/ClusterMetricsResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public void setMemoryAllocatedDisableThreshold(final Long memAllocated, final Lo
213213
}
214214
}
215215

216-
public void setDrsImbalance(String drsImbalance) {
216+
public void setDrsImbalance(Double drsImbalance) {
217217
if (drsImbalance != null) {
218218
this.drsImbalance = String.format("%.2f%%", drsImbalance);
219219
} else {

ui/src/components/view/ListView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@
338338
<span> {{ record.version }} </span>
339339
</template>
340340
<template v-if="column.key === 'drsimbalance'">
341-
<span> {{ record.drsimbalance.toFixed(3) }} </span>
341+
<span> {{ record.drsimbalance }} </span>
342342
</template>
343343
<template v-if="column.key === 'softwareversion'">
344344
<span> {{ record.softwareversion ? record.softwareversion : 'N/A' }} </span>

0 commit comments

Comments
 (0)