You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2012/12/09 15:14:19 UTC

svn commit: r1418966 - in /incubator/ambari/branches/AMBARI-666: ./ ambari-web/app/controllers/global/ ambari-web/app/templates/main/ ambari-web/app/templates/main/host/ ambari-web/app/templates/main/service/info/ ambari-web/app/views/main/ ambari-web/...

Author: yusaku
Date: Sun Dec  9 14:14:17 2012
New Revision: 1418966

URL: http://svn.apache.org/viewvc?rev=1418966&view=rev
Log:
AMBARI-1030. Metrics links in web ui should link to Ganglia UI. (Srimanth Gunturi via yusaku)

Modified:
    incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host/summary.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/summary.hbs
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/dashboard.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/summary.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/summary.js

Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1418966&r1=1418965&r2=1418966&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Sun Dec  9 14:14:17 2012
@@ -420,6 +420,9 @@ AMBARI-666 branch (unreleased changes)
 
   IMPROVEMENTS
 
+  AMBARI-1030. Metrics links in web ui should link to Ganglia UI. (Srimanth
+  Gunturi via yusaku)
+
   AMBARI-1025. Display total install and start services time on summary page
   and polish summary page ui. (Jaimin Jetly via yusaku)
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js?rev=1418966&r1=1418965&r2=1418966&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js Sun Dec  9 14:14:17 2012
@@ -77,6 +77,35 @@ App.ClusterController = Em.Controller.ex
   },
 
   /**
+   * Provides the URL to use for Ganglia server. This URL
+   * is helpful in populating links in UI.
+   *
+   * If null is returned, it means GANGLIA service is not installed.
+   */
+  gangliaUrl: function () {
+    if (App.testMode) {
+      return 'http://gangliaserver/ganglia/?t=yes';
+    } else {
+      // We want live data here
+      var svcs = App.Service.find();
+      var gangliaSvc = svcs.findProperty("serviceName", "GANGLIA");
+      if (gangliaSvc) {
+        var svcComponents = gangliaSvc.get('components');
+        if (svcComponents) {
+          var gangliaSvcComponent = svcComponents.findProperty("componentName", "GANGLIA_SERVER");
+          if (gangliaSvcComponent) {
+            var hostName = gangliaSvcComponent.get('host.hostName');
+            if (hostName) {
+              return "http://" + hostName + "/ganglia";
+            }
+          }
+        }
+      }
+      return null;
+    }
+  }.property('dataLoadList.services'),
+
+  /**
    * Provides the URL to use for NAGIOS server. This URL
    * is helpful in getting alerts data from server and also
    * in populating links in UI.

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs?rev=1418966&r1=1418965&r2=1418966&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/dashboard.hbs Sun Dec  9 14:14:17 2012
@@ -38,7 +38,9 @@
 			<div class="box-header">
 				<h4>Cluster Metrics</h4>
 				<div class="btn-group">
-          <a class="btn" href="http://gangliaserver/ganglia/?t=yes" target="_blank" rel="tooltip" title="Go to Ganglia"><i class="icon-link"></i></a>
+        </div>
+				<div class="btn-group">
+          <a class="btn" target="_blank" rel="tooltip" title="Go to Ganglia" {{bindAttr href="view.gangliaUrl"}}><i class="icon-link"></i></a>
         </div>
 			</div>
 			<div class="graphs-container">

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host/summary.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host/summary.hbs?rev=1418966&r1=1418965&r2=1418966&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host/summary.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/host/summary.hbs Sun Dec  9 14:14:17 2012
@@ -88,6 +88,9 @@
     <div class="box">
       <div class="box-header">
         <h4>Host Metrics</h4>
+        <div class="btn-group">
+          <a class="btn" rel="tooltip" title="Go to Ganglia" {{action "showGangliaCharts" target="view"}}><i class="icon-link"></i></a>
+        </div>
       </div>
       <div class="row-fluid">
 	     {{view App.MainHostMetricsView contentBinding="view.content"}}

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/summary.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/summary.hbs?rev=1418966&r1=1418965&r2=1418966&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/summary.hbs (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/templates/main/service/info/summary.hbs Sun Dec  9 14:14:17 2012
@@ -178,6 +178,9 @@
     <div class="box">
       <div class="box-header">
         <h4>{{controller.content.label}} Metrics</h4>
+        <div class="btn-group">
+          <a class="btn" target="_blank" rel="tooltip" title="Go to Ganglia" {{bindAttr href="view.gangliaUrl"}}><i class="icon-link"></i></a>
+        </div>
       </div>
       
       <div class="summary-metric-graphs row-fluid">

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/dashboard.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/dashboard.js?rev=1418966&r1=1418965&r2=1418966&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/dashboard.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/dashboard.js Sun Dec  9 14:14:17 2012
@@ -63,5 +63,9 @@ App.MainDashboardView = Em.View.extend({
       })
     }, this);
 
-  }.observes('App.router.clusterController.dataLoadList.services')
+  }.observes('App.router.clusterController.dataLoadList.services'),
+  
+  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')
 });
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/summary.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/summary.js?rev=1418966&r1=1418965&r2=1418966&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/summary.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/summary.js Sun Dec  9 14:14:17 2012
@@ -24,6 +24,13 @@ App.MainHostSummaryView = Em.View.extend
   content:function(){
     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=HDPNameNode&r=hour&cs=&ce=";
+    window.open(gangliaMobileUrl);
+  },
 
   ComponentButtonView: Em.View.extend({
     content: null,

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/summary.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/summary.js?rev=1418966&r1=1418965&r2=1418966&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/summary.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/summary.js Sun Dec  9 14:14:17 2012
@@ -148,7 +148,28 @@ App.MainServiceInfoSummaryView = Em.View
     this.set('oldServiceName', serviceName);
     serviceName = serviceName.toLowerCase();
   }.observes('serviceName'),
-
+  
+  gangliaUrl: function () {
+    var gangliaUrl = App.router.get('clusterController.gangliaUrl');
+    var svcName = this.get('service.serviceName');
+    if (svcName) {
+      switch (svcName.toLowerCase()) {
+        case 'hdfs':
+          gangliaUrl += "/?r=hour&cs=&ce=&m=&s=by+name&c=HDPNameNode&tab=m&vn=";
+          break;
+        case 'mapreduce':
+          gangliaUrl += "/?r=hour&cs=&ce=&m=&s=by+name&c=HDPJobTracker&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 () {
     // We have to make the height of the Alerts section
     // match the height of the Summary section.