Skip to content

Commit

Permalink
Show drs imbalance as percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
vishesh92 committed Feb 7, 2024
1 parent e90eae9 commit 66ef8db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ public List<ClusterMetricsResponse> listClusterMetrics(Pair<List<ClusterResponse

try {
Double imbalance = ClusterDrsAlgorithm.getClusterImbalance(clusterId, cpuList, memoryList, null);
metricsResponse.setDrsImbalance(imbalance.isNaN() ? null : String.format("%.2f%%", imbalance));
metricsResponse.setDrsImbalance(imbalance.isNaN() ? null : 100.0 * imbalance);
} catch (ConfigurationException e) {
LOGGER.warn("Failed to get cluster imbalance for cluster " + clusterId, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public void setMemoryAllocatedDisableThreshold(final Long memAllocated, final Lo
}
}

public void setDrsImbalance(String drsImbalance) {
public void setDrsImbalance(Double drsImbalance) {
if (drsImbalance != null) {
this.drsImbalance = String.format("%.2f%%", drsImbalance);
} else {
Expand Down

0 comments on commit 66ef8db

Please sign in to comment.