Browse Source

YARN-10469. YARN-UI2 The accuracy of the percentage values in the same chart on the YARN 'Cluster OverView' page are inconsistent (#2401)

neko 4 years ago
parent
commit
deea5d8f2b

+ 2 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-usage-donut-chart.js

@@ -48,7 +48,7 @@ export default BaseUsageDonutChart.extend({
 
     usageByApps.push({
       label: "Available",
-      value: avail.toFixed(4)
+      value: avail.toFixed(2)
     });
 
     this.colors = ColorUtils.getColors(usageByApps.length, ["others", "good"], true);
@@ -56,4 +56,4 @@ export default BaseUsageDonutChart.extend({
     this.renderDonutChart(usageByApps, this.get("title"), this.get("showLabels"),
       this.get("middleLabel"), "100%", "%");
   },
-});
+});

+ 2 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/queue-usage-donut-chart.js

@@ -51,7 +51,7 @@ export default BaseUsageDonutChart.extend({
 
     usageByQueues.push({
       label: "Available",
-      value: avail.toFixed(4)
+      value: avail.toFixed(2)
     });
 
     this.colors = ColorUtils.getColors(usageByQueues.length, ["others", "good"], true);
@@ -64,4 +64,4 @@ export default BaseUsageDonutChart.extend({
     this.initChart();
     this.draw();
   },
-});
+});