ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject [1/2] ambari git commit: AMBARI-13360. Redundant links to Ganglia Web UI
Date Thu, 08 Oct 2015 16:48:59 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 3c5d1ee74 -> c5075f016


AMBARI-13360. Redundant links to Ganglia Web UI


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

Branch: refs/heads/branch-2.1
Commit: c5075f016c8ef0704d9f3f232e018c83d75c782a
Parents: b6a31c5
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Thu Oct 8 19:46:51 2015 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Thu Oct 8 19:48:52 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |   1 -
 .../app/templates/main/dashboard/widgets.hbs    |   7 -
 ambari-web/app/templates/main/host/summary.hbs  |   9 -
 .../app/templates/main/service/info/summary.hbs |   3 -
 .../main/dashboard/cluster_metrics/memory.js    |  10 +-
 ambari-web/app/views/main/dashboard/widgets.js  |   7 -
 ambari-web/app/views/main/host/summary.js       |   6 -
 .../app/views/main/service/info/summary.js      |  19 --
 .../app/views/main/service/services/flume.js    |   2 -
 .../dashboard/cluster_metrics/memory_test.js    | 197 +++----------------
 .../test/views/main/dashboard/widgets_test.js   |  13 --
 11 files changed, 29 insertions(+), 245 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index f4134a9..74d569d 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2378,7 +2378,6 @@ Em.I18n.translations = {
   'dashboard.button.switch': 'Switch to classic dashboard',
   'dashboard.button.switchShort': 'Switch',
   'dashboard.button.reset': 'Reset all widgets to default ',
-  'dashboard.button.gangliaLink': 'View metrics in Ganglia',
   'dashboard.widgets.actions.title': 'Metric Actions',
   'dashboard.widgets.create': 'Create Widget',
   'dashboard.widgets.actions.browse': 'Browse Widgets',

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/app/templates/main/dashboard/widgets.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets.hbs b/ambari-web/app/templates/main/dashboard/widgets.hbs
index f55b9b9..57ab38d 100644
--- a/ambari-web/app/templates/main/dashboard/widgets.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets.hbs
@@ -35,13 +35,6 @@
               <i class="icon-refresh"></i> &nbsp; {{t dashboard.button.reset}}
             </a>
           </li>
-          {{#if App.router.clusterController.isGangliaInstalled}}
-            <li>
-              <a target="_blank" {{bindAttr href="view.gangliaUrl"}}>
-                <i class="icon-share"></i> &nbsp; {{t dashboard.button.gangliaLink}}
-              </a>
-            </li>
-          {{/if}}
         </ul>
       </li>
     </ul>

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/app/templates/main/host/summary.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/summary.hbs b/ambari-web/app/templates/main/host/summary.hbs
index dace65a..681154d 100644
--- a/ambari-web/app/templates/main/host/summary.hbs
+++ b/ambari-web/app/templates/main/host/summary.hbs
@@ -174,15 +174,6 @@
         <div class="box">
           <div class="box-header">
             <h4>{{t hosts.host.summary.hostMetrics}}</h4>
-            {{#if App.router.clusterController.isGangliaInstalled}}
-              <div class="btn-group">
-                {{#if App.router.clusterController.isGangliaUrlLoaded}}
-                  <a class="btn" rel="tooltip" title="Go to Ganglia" {{action "showGangliaCharts"
target="view"}}><i class="icon-link"></i></a>
-                {{else}}
-                  <div class="spinner"></div>
-                {{/if}}
-              </div>
-            {{/if}}
             {{view view.timeRangeListView}}
           </div>
           <div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/app/templates/main/service/info/summary.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary.hbs b/ambari-web/app/templates/main/service/info/summary.hbs
index 9326623..af8078d 100644
--- a/ambari-web/app/templates/main/service/info/summary.hbs
+++ b/ambari-web/app/templates/main/service/info/summary.hbs
@@ -160,9 +160,6 @@
                 <i class="pull-left icon-caret-toggle"></i>
                 <span>{{collapsedSection.header}}</span>
               </span>
-              <a class="btn pull-right" {{bindAttr href="collapsedSection.url"}} target="_blank">
-                <i class="icon-link"></i>
-              </a>
 
               <div class="clearfix"></div>
             </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/app/views/main/dashboard/cluster_metrics/memory.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/cluster_metrics/memory.js b/ambari-web/app/views/main/dashboard/cluster_metrics/memory.js
index 510c6b0..db1988e 100644
--- a/ambari-web/app/views/main/dashboard/cluster_metrics/memory.js
+++ b/ambari-web/app/views/main/dashboard/cluster_metrics/memory.js
@@ -38,20 +38,14 @@ App.ChartClusterMetricsMemory = App.ChartLinearTimeView.extend({
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.memory) {
-      var isAmbariMetricsAvailable = App.StackService.find().someProperty('serviceName',
'AMBARI_METRICS');
-      var isAmbariMetricsInstalled = App.Service.find().someProperty('serviceName', 'AMBARI_METRICS');
-      var isGangliaInstalled = App.Service.find().someProperty('serviceName', 'GANGLIA');
-      var shouldConvertToBytes = isAmbariMetricsInstalled || isAmbariMetricsAvailable &&
!isGangliaInstalled;
       var KB = Math.pow(2, 10);
       for ( var name in jsonData.metrics.memory) {
         var displayName = name;
         var seriesData = jsonData.metrics.memory[name];
         if (seriesData) {
           var s = this.transformData(seriesData, displayName);
-          if (shouldConvertToBytes) {
-            for (var i = 0; i < s.data.length; i++) {
-              s.data[i].y *= KB;
-            }
+          for (var i = 0; i < s.data.length; i++) {
+            s.data[i].y *= KB;
           }
           seriesArray.push(s);
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/app/views/main/dashboard/widgets.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets.js b/ambari-web/app/views/main/dashboard/widgets.js
index 264fda7..f98c619 100644
--- a/ambari-web/app/views/main/dashboard/widgets.js
+++ b/ambari-web/app/views/main/dashboard/widgets.js
@@ -514,13 +514,6 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage,
Ap
     });
   },
 
-  /**
-   * @type {string}
-   */
-  gangliaUrl: function () {
-    return App.router.get('clusterController.gangliaUrl') + "/?r=hour&cs=&ce=&m=&s=by+name&c=HDPSlaves&tab=m&vn=";
-  }.property('App.router.clusterController.gangliaUrl'),
-
   showAlertsPopup: Em.K
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/app/views/main/host/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js
index a01df69..59cfd1a 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -53,12 +53,6 @@ App.MainHostSummaryView = Em.View.extend(App.TimeRangeMixin, {
     return App.router.get('mainHostDetailsController.content');
   }.property('App.router.mainHostDetailsController.content'),
 
-  showGangliaCharts: function () {
-    var name = this.get('content.hostName');
-    var gangliaMobileUrl = App.router.get('clusterController.gangliaUrl') + "/mobile_helper.php?show_host_metrics=1&h="
+ name + "&c=HDPSlaves&r=hour&cs=&ce=";
-    window.open(gangliaMobileUrl);
-  },
-
   /**
    * Host metrics panel not displayed when Metrics service (ex:Ganglia) is not in stack definition.
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js
index 0eb2d7c..1a73eb1 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -545,25 +545,6 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, App.TimeRangeMixin
     return !App.get('services.serviceMetrics').length;
   }.property('App.services.serviceMetrics'),
 
-  gangliaUrl:function () {
-    var gangliaUrl = App.router.get('clusterController.gangliaUrl');
-    if (!gangliaUrl) return null;
-    var svcName = this.get('service.serviceName');
-    if (svcName) {
-      switch (svcName.toLowerCase()) {
-        case 'hdfs':
-          gangliaUrl += "/?r=hour&cs=&ce=&m=&s=by+name&c=HDPSlaves&tab=m&vn=";
-          break;
-        case 'hbase':
-          gangliaUrl += "?r=hour&cs=&ce=&m=&s=by+name&c=HDPHBaseMaster&tab=m&vn=";
-          break;
-        default:
-          break;
-      }
-    }
-    return gangliaUrl;
-  }.property('App.router.clusterController.gangliaUrl', 'service.serviceName'),
-
   didInsertElement: function () {
     var svcName = this.get('controller.content.serviceName');
     this.set('service', this.getServiceModel(svcName));

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/app/views/main/service/services/flume.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/flume.js b/ambari-web/app/views/main/service/services/flume.js
index 013a10b..1ab89f9 100644
--- a/ambari-web/app/views/main/service/services/flume.js
+++ b/ambari-web/app/views/main/service/services/flume.js
@@ -153,7 +153,6 @@ App.MainDashboardServiceFlumeView = App.TableView.extend(App.MainDashboardServic
       var metricType = Em.I18n.t('services.service.info.metrics.flume.' + metricTypeKey).format(Em.I18n.t('common.metrics'));
       return  metricType + ' - ' + hostName;
     };
-    var gangliaUrlTpl = App.router.get('clusterController.gangliaUrl') + '/?r=hour&cs=&ce=&m=load_one&s=by+name&c=HDPFlumeServer&h={0}&host_regex=&max_graphs=0&tab=m&vn=&sh=1&z=small&hc=4';
     var agentHostMock = host.get('hostName');
     var mockMetricData = [
       {
@@ -183,7 +182,6 @@ App.MainDashboardServiceFlumeView = App.TableView.extend(App.MainDashboardServic
     ];
     mockMetricData.forEach(function(mockData, index) {
       mockData.header = getMetricTitle(mockData.header, agentHostMock);
-      mockData.url = gangliaUrlTpl.format(agentHostMock);
       mockData.id = 'metric' + index;
       mockData.toggleIndex = '#' + mockData.id;
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/test/views/main/dashboard/cluster_metrics/memory_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/dashboard/cluster_metrics/memory_test.js b/ambari-web/test/views/main/dashboard/cluster_metrics/memory_test.js
index 2512166..5e7bc516 100644
--- a/ambari-web/test/views/main/dashboard/cluster_metrics/memory_test.js
+++ b/ambari-web/test/views/main/dashboard/cluster_metrics/memory_test.js
@@ -30,147 +30,7 @@ describe('App.ChartClusterMetricsMemory', function () {
 
   describe('#transformToSeries', function () {
 
-    var cases = [
-        {
-          isAmbariMetricsInstalled: true,
-          seriesData: [
-            [
-              {
-                x: 1000000000,
-                y: 262144
-              },
-              {
-                x: 1000001000,
-                y: 524288
-              }
-            ],
-            [
-              {
-                x: 1100000000,
-                y: 1048576
-              },
-              {
-                x: 1100001000,
-                y: 2097152
-              }
-            ]
-          ],
-          title: 'Ambari Metrics is installed'
-        },
-        {
-          isAmbariMetricsInstalled: false,
-          isAmbariMetricsAvailable: true,
-          isGangliaInstalled: false,
-          seriesData: [
-            [
-              {
-                x: 1000000000,
-                y: 262144
-              },
-              {
-                x: 1000001000,
-                y: 524288
-              }
-            ],
-            [
-              {
-                x: 1100000000,
-                y: 1048576
-              },
-              {
-                x: 1100001000,
-                y: 2097152
-              }
-            ]
-          ],
-          title: 'Ganglia is not installed, Ambari Metrics is available'
-        },
-        {
-          isAmbariMetricsInstalled: false,
-          isAmbariMetricsAvailable: true,
-          isGangliaInstalled: true,
-          seriesData: [
-            [
-              {
-                x: 1000000000,
-                y: 256
-              },
-              {
-                x: 1000001000,
-                y: 512
-              }
-            ],
-            [
-              {
-                x: 1100000000,
-                y: 1024
-              },
-              {
-                x: 1100001000,
-                y: 2048
-              }
-            ]
-          ],
-          title: 'Ganglia is installed, Ambari Metrics is available'
-        },
-        {
-          isAmbariMetricsInstalled: false,
-          isAmbariMetricsAvailable: false,
-          isGangliaInstalled: true,
-          seriesData: [
-            [
-              {
-                x: 1000000000,
-                y: 256
-              },
-              {
-                x: 1000001000,
-                y: 512
-              }
-            ],
-            [
-              {
-                x: 1100000000,
-                y: 1024
-              },
-              {
-                x: 1100001000,
-                y: 2048
-              }
-            ]
-          ],
-          title: 'Ganglia is installed, Ambari Metrics is not available'
-        },
-        {
-          isAmbariMetricsInstalled: false,
-          isAmbariMetricsAvailable: false,
-          isGangliaInstalled: false,
-          seriesData: [
-            [
-              {
-                x: 1000000000,
-                y: 256
-              },
-              {
-                x: 1000001000,
-                y: 512
-              }
-            ],
-            [
-              {
-                x: 1100000000,
-                y: 1024
-              },
-              {
-                x: 1100001000,
-                y: 2048
-              }
-            ]
-          ],
-          title: 'Ganglia is not installed, Ambari Metrics is not available'
-        }
-      ],
-      jsonData = {
+    var jsonData = {
         metrics: {
           memory: {
             Buffer: [
@@ -184,38 +44,35 @@ describe('App.ChartClusterMetricsMemory', function () {
           }
         }
       },
-      names = ['Buffer', 'Total'];
-
-    afterEach(function () {
-      App.StackService.find.restore();
-      App.Service.find.restore();
-    });
+      seriesData = [
+        [
+          {
+            x: 1000000000,
+            y: 262144
+          },
+          {
+            x: 1000001000,
+            y: 524288
+          }
+        ],
+        [
+          {
+            x: 1100000000,
+            y: 1048576
+          },
+          {
+            x: 1100001000,
+            y: 2097152
+          }
+        ]
+      ],
+      names = ['Buffer', 'Total'],
+      title = 'should transform data to series';
 
-    cases.forEach(function (item) {
-      it(item.title, function () {
-        var stackServices = [],
-          services = [];
-        if (item.isAmbariMetricsAvailable) {
-          stackServices.push({
-            serviceName: 'AMBARI_METRICS'
-          });
-        }
-        if (item.isAmbariMetricsInstalled) {
-          services.push({
-            serviceName: 'AMBARI_METRICS'
-          });
-        }
-        if (item.isGangliaInstalled) {
-          services.push({
-            serviceName: 'GANGLIA'
-          });
-        }
-        sinon.stub(App.StackService, 'find').returns(stackServices);
-        sinon.stub(App.Service, 'find').returns(services);
+      it(title, function () {
         var series = view.transformToSeries(jsonData);
         expect(series.mapProperty('name')).to.eql(names);
-        expect(series.mapProperty('data')).to.eql(item.seriesData);
-      });
+        expect(series.mapProperty('data')).to.eql(seriesData);
     });
 
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5075f01/ambari-web/test/views/main/dashboard/widgets_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/dashboard/widgets_test.js b/ambari-web/test/views/main/dashboard/widgets_test.js
index 0768c77..b0e2f14 100644
--- a/ambari-web/test/views/main/dashboard/widgets_test.js
+++ b/ambari-web/test/views/main/dashboard/widgets_test.js
@@ -454,19 +454,6 @@ describe('App.MainDashboardWidgetsView', function () {
     });
   });
 
-  describe("#gangliaUrl", function () {
-    before(function () {
-      sinon.stub(App.router, 'get').withArgs('clusterController.gangliaUrl').returns('url');
-    });
-    after(function () {
-      App.router.get.restore();
-    });
-    it("", function () {
-      view.propertyDidChange('gangliaUrl');
-      expect(view.get('gangliaUrl')).to.equal('url/?r=hour&cs=&ce=&m=&s=by+name&c=HDPSlaves&tab=m&vn=');
-    });
-  });
-
   describe('#checkServicesChange', function () {
 
     var emptyCurrentPref = {


Mime
View raw message