ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject ambari git commit: AMBARI-17265. [Grafana] HBase Tables metric query fix. (Prajwal Rao via yusaku)
Date Mon, 20 Jun 2016 19:08:48 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk dddad6101 -> 5b1f361c4


AMBARI-17265. [Grafana] HBase Tables metric query fix. (Prajwal Rao via yusaku)


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

Branch: refs/heads/trunk
Commit: 5b1f361c45980951868716d2aefbac42b525f197
Parents: dddad61
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Mon Jun 20 12:08:18 2016 -0700
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Mon Jun 20 12:08:18 2016 -0700

----------------------------------------------------------------------
 .../ambari-metrics-grafana/ambari-metrics/datasource.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5b1f361c/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
index b825774..6a4f01b 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
@@ -227,11 +227,8 @@ define([
           var getHbaseAppIdData = function(target) {
             var precision = target.precision === 'default' || typeof target.precision ==
'undefined'  ? '' : '&precision='
             + target.precision;
-            var metricAggregator = target.aggregator === "none" ? '' : '._' + target.aggregator;
-            var metricTransform = !target.transform || target.transform === "none" ? '' :
'._' + target.transform;
-            return backendSrv.get(self.url + '/ws/v1/timeline/metrics?metricNames=' + target.hbMetric
+ metricTransform
-              + metricAggregator + '&appId=hbase&startTime=' + from +
-              '&endTime=' + to + precision).then(
+            return backendSrv.get(self.url + '/ws/v1/timeline/metrics?metricNames=' + target.hbMetric
+ '&appId=hbase&startTime=' 
+            + from + '&endTime=' + to + precision).then(
               allHostMetricsData(target)
             );
           };
@@ -302,7 +299,8 @@ define([
               _.forEach(selectedUser, function(processUser) {
                   metricsPromises.push(_.map(options.targets, function(target) {
                     target.hbUser = processUser;
-                    target.hbMetric = target.metric.replace('*', target.hbUser);
+                    var metricTransform = !target.transform || target.transform === "none"
? '' : '._' + target.transform;
+                    target.hbMetric = target.metric.replace('*', target.hbUser) + metricTransform
+'._' +  target.aggregator;
                     return getHbaseAppIdData(target);
                   }));
                 });
@@ -320,6 +318,8 @@ define([
                 metricsPromises.push(_.map(options.targets, function(target) {
                   var hbMetric = [];
                   _.map(table, function(tableMetric) { hbMetric.push(target.metric.replace('*',
tableMetric)); });
+                  var metricTransform = !target.transform || target.transform === "none"
? '' : '._' + target.transform; 
+                  hbMetric = _.map(hbMetric, function(tbl) { return tbl + metricTransform
+'._' +  target.aggregator; });
                   target.hbMetric = _.flatten(hbMetric).join(',');
                   return getHbaseAppIdData(target);
                 }));


Mime
View raw message