Browse Source

AMBARI-3093 Incorrect units of measure for "HBase Master Heap" widget on Dashboard. (atkach)

atkach 11 years ago
parent
commit
dea1f811a0

+ 8 - 0
ambari-web/app/views/main/dashboard/widgets/hbase_master_heap.js

@@ -32,5 +32,13 @@ App.HBaseMasterHeapPieChartView = App.PieChartDashboardWidgetView.extend({
   didInsertElement: function() {
     this._super();
     this.calc();
+  },
+
+  getUsed: function() {
+    return (this.get('model').get(this.get('modelFieldUsed')) / (1024 * 1024)) || 0;
+  },
+
+  getMax: function() {
+    return (this.get('model').get(this.get('modelFieldMax')) / (1024 * 1024)) || 0;
   }
 });

+ 0 - 8
ambari-web/app/views/main/dashboard/widgets/namenode_heap.js

@@ -32,13 +32,5 @@ App.NameNodeHeapPieChartView = App.PieChartDashboardWidgetView.extend({
   didInsertElement: function() {
     this._super();
     this.calc();
-  },
-
-  getUsed: function() {
-    return this.get('model').get(this.get('modelFieldUsed')) * 1024 * 1024 || 0;
-  },
-
-  getMax: function() {
-    return this.get('model').get(this.get('modelFieldMax')) * 1024 * 1024 || 0;
   }
 });