ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-14976 Add Grafana QuickLinks for AMS Service in Ambari Web. (atkach)
Date Thu, 11 Feb 2016 19:23:11 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 5f7166c6e -> e43e12f85


AMBARI-14976 Add Grafana QuickLinks for AMS Service in Ambari Web. (atkach)


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

Branch: refs/heads/branch-2.2
Commit: e43e12f85343db320ff5b5ec2f7942bdeaedbeca
Parents: 5f7166c
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Tue Feb 9 19:52:40 2016 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Thu Feb 11 21:20:40 2016 +0200

----------------------------------------------------------------------
 .../app/mappers/service_metrics_mapper.js       |  3 +-
 ambari-web/app/models/quick_links.js            | 12 +++++++
 .../app/views/common/quick_view_link_view.js    | 37 +++++++++++++++-----
 3 files changed, 43 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e43e12f8/ambari-web/app/mappers/service_metrics_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js b/ambari-web/app/mappers/service_metrics_mapper.js
index 2deceaf..30a96d6 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -387,7 +387,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       RANGER: [33],
       SPARK: [34],
       ACCUMULO: [35],
-      ATLAS: [36]
+      ATLAS: [36],
+      AMBARI_METRICS: [37]
     };
     if (quickLinks[item.ServiceInfo.service_name])
       finalJson.quick_links = quickLinks[item.ServiceInfo.service_name];

http://git-wip-us.apache.org/repos/asf/ambari/blob/e43e12f8/ambari-web/app/models/quick_links.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/quick_links.js b/ambari-web/app/models/quick_links.js
index 1aac608..94c793d 100644
--- a/ambari-web/app/models/quick_links.js
+++ b/ambari-web/app/models/quick_links.js
@@ -343,6 +343,18 @@ App.QuickLinks.FIXTURES = [
     regex: '^(\\d+)$',
     default_http_port: 21000,
     default_https_port: 21443
+  },
+  {
+    id:37,
+    label:'Metrics UI Server',
+    url:'%@://%@:%@',
+    service_id: 'AMBARI_METRICS',
+    template:'%@://%@:%@',
+    http_config: 'port',
+    site: 'ams-grafana-ini',
+    regex: '^(\\d+)$',
+    default_http_port: 3000,
+    default_https_port: 3000
   }
 
 ];

http://git-wip-us.apache.org/repos/asf/ambari/blob/e43e12f8/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index ece034c..774d87d 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -75,7 +75,29 @@ App.QuickViewLinks = Em.View.extend({
   /**
    * list of files that contains properties for enabling/disabling ssl
    */
-  requiredSiteNames: ['hadoop-env','yarn-env','hbase-env','oozie-env','mapred-env','storm-env',
'falcon-env', 'core-site', 'hdfs-site', 'hbase-site', 'oozie-site', 'yarn-site', 'mapred-site',
'storm-site', 'spark-defaults', 'accumulo-site', 'application-properties', 'ranger-admin-site',
'ranger-site', 'admin-properties'],
+  requiredSiteNames: [
+    'ams-grafana-ini',
+    'hadoop-env',
+    'yarn-env',
+    'hbase-env',
+    'oozie-env',
+    'mapred-env',
+    'storm-env',
+    'falcon-env',
+    'core-site',
+    'hdfs-site',
+    'hbase-site',
+    'oozie-site',
+    'yarn-site',
+    'mapred-site',
+    'storm-site',
+    'spark-defaults',
+    'accumulo-site',
+    'application-properties',
+    'ranger-admin-site',
+    'ranger-site',
+    'admin-properties'
+  ],
   /**
    * Get public host name by its host name.
    *
@@ -365,6 +387,9 @@ App.QuickViewLinks = Em.View.extend({
       case "ATLAS":
         hosts[0] = this.findComponentHost(response.items, "ATLAS_SERVER");
         break;
+      case "AMBARI_METRICS":
+        hosts[0] = this.findComponentHost(response.items, "METRICS_GRAFANA");
+        break;
       case "MAPREDUCE2":
         components = this.get('content.hostComponents').filterProperty('componentName', 'HISTORYSERVER');
         if (components && components.length > 1) {
@@ -412,7 +437,9 @@ App.QuickViewLinks = Em.View.extend({
     switch (service_id) {
       case "GANGLIA":
         return (ambariProperties && ambariProperties['ganglia.https'] == "true")
? "https" : "http";
-        break;
+      case "AMBARI_METRICS":
+        var grafanaProperties = configProperties && configProperties.findProperty('type',
'ams-grafana-ini');
+        return grafanaProperties.properties['protocol'] ? grafanaProperties.properties['protocol']
: 'http';
       case "YARN":
         var yarnProperties = configProperties && configProperties.findProperty('type',
'yarn-site');
         if (yarnProperties && yarnProperties.properties) {
@@ -423,7 +450,6 @@ App.QuickViewLinks = Em.View.extend({
           }
         }
         return hadoopSslEnabled ? "https" : "http";
-        break;
       case "MAPREDUCE2":
         var mapred2Properties = configProperties && configProperties.findProperty('type',
'mapred-site');
         if (mapred2Properties && mapred2Properties.properties) {
@@ -434,7 +460,6 @@ App.QuickViewLinks = Em.View.extend({
           }
         }
         return hadoopSslEnabled ? "https" : "http";
-        break;
       case "ACCUMULO":
         var accumuloProperties = configProperties && configProperties.findProperty('type',
'accumulo-site');
         if (accumuloProperties && accumuloProperties.properties) {
@@ -445,7 +470,6 @@ App.QuickViewLinks = Em.View.extend({
           }
         }
         return "http";
-        break;
       case "ATLAS":
         var atlasProperties = configProperties && configProperties.findProperty('type',
'application-properties');
         if (atlasProperties && atlasProperties.properties) {
@@ -456,7 +480,6 @@ App.QuickViewLinks = Em.View.extend({
           }
         }
         return "http";
-        break;
       case "OOZIE":
         var site = configProperties.findProperty('type', 'oozie-site');
         var properties = site && site.properties;
@@ -472,7 +495,6 @@ App.QuickViewLinks = Em.View.extend({
           protocol = 'https';
         }
         return protocol;
-        break;
       case "RANGER":
         var rangerProperties = configProperties && configProperties.findProperty('type',
'ranger-admin-site');
         var rangerSiteProperties = configProperties && configProperties.findProperty('type',
'ranger-site');
@@ -492,7 +514,6 @@ App.QuickViewLinks = Em.View.extend({
         } else {
           return "http";
         }
-        break;
       default:
         return this.get('servicesSupportsHttps').contains(service_id) && hadoopSslEnabled
? "https" : "http";
     }


Mime
View raw message