You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2015/06/24 13:44:00 UTC

ambari git commit: AMBARI-12117 Heatmaps: Maximum input is reseting every 15 seconds. (atkach)

Repository: ambari
Updated Branches:
  refs/heads/trunk 81427c528 -> 0004fd99f


AMBARI-12117 Heatmaps: Maximum input is reseting every 15 seconds. (atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0004fd99
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0004fd99
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0004fd99

Branch: refs/heads/trunk
Commit: 0004fd99fc47f7a7c678b13c3f4c242869d69445
Parents: 81427c5
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Wed Jun 24 14:07:04 2015 +0300
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Wed Jun 24 14:34:33 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/utils/ajax/ajax.js                  |  2 +-
 .../app/views/common/widget/heatmap_widget_view.js | 17 ++++++++++-------
 2 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0004fd99/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index f344816..bf482ab 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2544,7 +2544,7 @@ var urls = {
   },
 
   'widgets.hosts.metrics.get': {
-    real: '/clusters/{clusterName}/hosts?fields={metricPaths}&format=null_padding',
+    real: '/clusters/{clusterName}/hosts?fields={metricPaths}',
     mock: '/data/metrics/{serviceName}/Append_num_ops.json'
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0004fd99/ambari-web/app/views/common/widget/heatmap_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/widget/heatmap_widget_view.js b/ambari-web/app/views/common/widget/heatmap_widget_view.js
index c89275a..4c888e5 100644
--- a/ambari-web/app/views/common/widget/heatmap_widget_view.js
+++ b/ambari-web/app/views/common/widget/heatmap_widget_view.js
@@ -28,11 +28,18 @@ App.HeatmapWidgetView = Em.View.extend(App.WidgetMixin, {
   metrics: [],
 
   /**
-   *  racks container  binded in the template
+   *  racks container bound in the template
    *  @type {Array}
    */
   racks: [],
 
+  onMetricsLoaded: function () {
+    if (!this.get('isLoaded')) {
+      this.set('controller.inputMaximum', this.get('content.properties.max_limit'));
+    }
+    this._super();
+  },
+
   /**
    * draw widget
    */
@@ -49,14 +56,12 @@ App.HeatmapWidgetView = Em.View.extend(App.WidgetMixin, {
       var metricObject = App.MainChartHeatmapMetric.create({
         name: this.get('content.displayName'),
         units: this.get('content.properties.display_unit'),
-        maximumValue: this.get('content.properties.max_limit'),
+        maximumValue: this.get('controller.inputMaximum'),
         hostNames: hostNames,
         hostToValueMap: hostToValueMap
       });
 
       this.set('controller.selectedMetric', metricObject);
-
-      this.set('controller.inputMaximum', metricObject.get('maximumValue'));
     }
   },
 
@@ -64,9 +69,7 @@ App.HeatmapWidgetView = Em.View.extend(App.WidgetMixin, {
    * calculate value for heatmap widgets
    */
   calculateValues: function () {
-    var metrics = this.get('metrics');
-    var hostToValueMap = this.computeExpression(this.extractExpressions(this.get('content.values')[0]), metrics);
-    return hostToValueMap;
+    return this.computeExpression(this.extractExpressions(this.get('content.values')[0]), this.get('metrics'));
   },