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-15255. Default aggregation values should be None for SECONDS precision in Grafana when a Host is selected. (Prajwal Rao via yusaku)
Date Wed, 02 Mar 2016 18:11:24 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 0b80ca7d2 -> a5a5c0959


AMBARI-15255. Default aggregation values should be None for SECONDS precision in Grafana when
a Host is selected. (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/a5a5c095
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a5a5c095
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a5a5c095

Branch: refs/heads/branch-2.2
Commit: a5a5c09595122413ba9f0afaf6d5e989e64c133e
Parents: 0b80ca7
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Wed Mar 2 10:10:38 2016 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Wed Mar 2 10:11:19 2016 -0800

----------------------------------------------------------------------
 .../ambari-metrics-grafana/ambari-metrics/datasource.js |  1 +
 .../ambari-metrics-grafana/ambari-metrics/queryCtrl.js  | 12 ++++++++++++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a5a5c095/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 49fef8d..43de3dd 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
@@ -128,6 +128,7 @@ define([
           var getHostAppIdData = function(target) {
             var precision = target.shouldAddPrecision ? '&precision=' + target.precision
: '';
             var rate = target.shouldComputeRate ? '._rate._' : '._';
+            target.aggregator = target.precision !== "seconds" ? target.aggregator : '';
             return backendSrv.get(self.url + '/ws/v1/timeline/metrics?metricNames=' + target.metric
+ rate +
                 target.aggregator + "&hostname=" + target.hosts + '&appId=' + target.app
+ '&startTime=' + from +
                 '&endTime=' + to + precision).then(

http://git-wip-us.apache.org/repos/asf/ambari/blob/a5a5c095/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
index 494ae16..97b76b9 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
@@ -35,6 +35,18 @@ define([
             $scope.target.aggregator = 'avg';
           }
 
+          if (!$scope.target.shouldAddPrecision) {
+            $scope.target.precision = '';
+          }
+
+          $scope.target.precision = $scope.precisions[1];
+          
+          $scope.$watch('target.precision', function() {
+            if ($scope.target.precision !== "seconds") {
+              $scope.target.aggregator = 'avg';
+            }
+          });
+
           if (!$scope.target.downsampleAggregator) {
             $scope.target.downsampleAggregator = 'avg';
           }


Mime
View raw message