eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject eagle git commit: [EAGLE-924] urls to healthy and unhealthy region-servers in hbase dashboard is not accurate enough
Date Tue, 28 Feb 2017 05:54:52 GMT
Repository: eagle
Updated Branches:
  refs/heads/master af33ae3c3 -> 97ae1da52


[EAGLE-924] urls to healthy and unhealthy region-servers in hbase dashboard is not accurate
enough

[EAGLE-924]urls to healthy and unhealthy region-servers in hbase dashboard is not accurate
enough

- Add status filter in web url,append "?status=healthy" or "?status=unhealthy" to the url
- Fix exception when we change time interval
- Fix dashboard show when no data and exception.

https://issues.apache.org/jira/browse/EAGLE-924

Author: chitin <chitin1027@gmail.com>

Closes #840 from chitin/eagle924.


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

Branch: refs/heads/master
Commit: 97ae1da52d09d8c22b37a63b53dac0649b2c024f
Parents: af33ae3
Author: chitin <chitin1027@gmail.com>
Authored: Tue Feb 28 13:54:40 2017 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Tue Feb 28 13:54:40 2017 +0800

----------------------------------------------------------------------
 .../webapp/app/apps/hbase/ctrls/overview.js     | 56 +++++++++++++-----
 .../app/apps/hbase/ctrls/regionListCtrl.js      |  4 +-
 .../src/main/webapp/app/apps/hbase/index.js     | 25 ++++++--
 .../app/apps/hbase/partials/overview.html       | 49 +++++++++-------
 .../hbase/partials/region/regionDetail.html     | 12 ++--
 .../app/apps/hbase/widgets/availabilityChart.js | 45 +++++++++++----
 .../app/apps/hdfs/ctrl/datanodeListCtrl.js      |  4 +-
 .../app/apps/hdfs/ctrl/namenodeListCtrl.js      |  4 +-
 .../main/webapp/app/apps/hdfs/ctrl/overview.js  | 55 +++++++++++++-----
 .../src/main/webapp/app/apps/hdfs/index.js      | 10 ++--
 .../app/apps/hdfs/partials/datanodeList.html    |  2 +-
 .../webapp/app/apps/hdfs/partials/overview.html | 61 ++++++++++++--------
 .../app/apps/hdfs/widget/availabilityChart.js   | 45 +++++++++++----
 13 files changed, 259 insertions(+), 113 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/overview.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/overview.js
b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/overview.js
index 6e7df0b..2416e63 100644
--- a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/overview.js
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/overview.js
@@ -59,7 +59,11 @@
 
 				$scope.site = $wrapState.param.siteId;
 				var result = cache[name] || activeMasterInfo._promise.then(function (res) {
-						var hostname = cache[hostname] = cache[hostname] || res[0].tags.hostname;
+						if(typeof res[0] === 'undefined' || res.length === 0) {
+							return [];
+						}
+
+						var hostname = res[0].tags.hostname;
 						$scope.defaultHostname = $wrapState.param.hostname || hostname;
 
 						var jobCond = {
@@ -239,7 +243,7 @@
 							var series = [];
 							for (var r = 0; r < resp.length; r += 1) {
 								var rs = resp[r][1];
-								if (rs.length > 0) {
+								if (typeof rs !== 'undefined' && rs.length > 0) {
 									series.push(rs);
 								}
 							}
@@ -252,44 +256,70 @@
 					$.map(res, function (data) {
 						$scope.hmasteractivenum = data.value[0];
 					});
+				}, function () {
+					$scope.hmasteractivenum = -1;
 				});
 				countHBaseRole($scope.site, "standby", "hmaster", ["site"], "count")._promise.then(function
(res) {
 					$.map(res, function (data) {
 						$scope.hmasterstandbynum = data.value[0];
 					});
+				}, function () {
+					$scope.hmasterstandbynum = -1;
 				});
-
 				countHBaseRole($scope.site, "live", "regionserver", ["site"], "count")._promise.then(function
(res) {
 					$.map(res, function (data) {
 						$scope.regionserverhealtynum = data.value[0];
 					});
+				}, function () {
+					$scope.regionserverhealtynum = -1;
 				});
 				countHBaseRole($scope.site, "dead", "regionserver", ["site"], "count")._promise.then(function
(res) {
 					$.map(res, function (data) {
 						$scope.regionserverunhealtynum = data.value[0];
 					});
+				}, function () {
+					$scope.regionserverunhealtynum = -1;
 				});
 				sumAllRegions($scope.site, "regionserver", ["site"], "sum(numRegions)")._promise.then(function
(res) {
 					$.map(res, function (data) {
 						$scope.regionsnum = data.value[0];
 					});
+				}, function () {
+					$scope.regionsnum = -1;
 				});
 
 				activeMasterInfo._promise.then(function (res) {
-					var hostname = cache[hostname] = cache[hostname] || res[0].tags.hostname;
-					$scope.defaultHostname = $wrapState.param.hostname || hostname;
-					var jobCond = {
-						site: $scope.site,
-						component: "hbasemaster",
-						host: $scope.defaultHostname
-					};
-					METRIC.hbaseMomentMetric(jobCond, "hadoop.hbase.master.server.averageload", 1).then(function
(res) {
-						$scope.hmasteraverageload = (typeof res.data.obj[0] !== 'undefined') ? res.data.obj[0].value[0]
: "-1";
-					});
+					if(typeof res[0] !== 'undefined' && res.length > 0) {
+						var hostname = cache[hostname] = cache[hostname] || res[0].tags.hostname;
+						$scope.defaultHostname = $wrapState.param.hostname || hostname;
+						var jobCond = {
+							site: $scope.site,
+							component: "hbasemaster",
+							host: $scope.defaultHostname
+						};
+						METRIC.hbaseMomentMetric(jobCond, "hadoop.hbase.master.server.averageload", 1).then(function
(res) {
+							$scope.hmasteraverageload = (typeof res.data.obj[0] !== 'undefined') ? res.data.obj[0].value[0]
: -1;
+						}, function () {
+							$scope.hmasteraverageload = -1;
+						});
+					}
+				}, function () {
+					$scope.hmasteraverageload = -1;
 				});
 			};
 			Time.onReload(function () {
 				cache = {};
+                $.each($scope.chartList, function (i) {
+                    var chart = $scope.chartList[i];
+                    var chartname = chart.name;
+                    $scope.metricList[chartname] = {
+                        title: chartname,
+                        series: {},
+                        option: {},
+                        loading: true,
+                        promises: []
+                    };
+                });
 				$scope.refresh();
 			}, $scope);
 			$scope.refresh();

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionListCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionListCtrl.js
b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionListCtrl.js
index 1477e32..6fc9ab0 100644
--- a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionListCtrl.js
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionListCtrl.js
@@ -30,9 +30,9 @@
 			$scope.live = METRIC.STATUS_LIVE;
 			$scope.dead = METRIC.STATUS_DEAD;
 			$scope.site = $wrapState.param.siteId;
+			$scope.status = $wrapState.param.status;
 			$scope.searchPathList = [["tags", "hostname"], ["tags", "rack"], ["tags", "site"], ["status"]];
-			$scope.regionserverList = METRIC.regionserverList($scope.site);
-
+			$scope.regionserverList = METRIC.regionserverList($scope.site, $scope.status);
 		});
 	});
 })();

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.js b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.js
index c6b5135..8e4ea46 100644
--- a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.js
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.js
@@ -35,7 +35,7 @@
 		controller: "regionDetailCtrl",
 		resolve: {time: true}
 	}).route("regionList", {
-		url: "/hadoopService/HBase/regionList",
+		url: "/hadoopService/HBase/regionList?status",
 		site: true,
 		templateUrl: "partials/region/regionList.html",
 		controller: "regionListCtrl"
@@ -265,6 +265,8 @@
 				});
 				_list.done = true;
 				return _list;
+			}, function () {
+				return [];
 			});
 			return _list;
 		};
@@ -300,12 +302,23 @@
 			return hoststateinfo;
 		};
 
-		METRIC.regionserverList = function (siteid) {
+		METRIC.regionserverList = function (siteid, status) {
 			var hoststateinfos;
-			var condition = {
-				site: siteid,
-				role: "regionserver"
-			};
+			var condition = {};
+			if(typeof status === 'undefined') {
+				condition = {
+					site: siteid,
+					role: "regionserver"
+				};
+			} else {
+				condition = {
+					site: siteid,
+					role: "regionserver",
+					status: status
+				};
+			}
+			console.log(condition);
+
 			hoststateinfos = METRIC.hbasehostStatus(condition);
 			return hoststateinfos;
 		};

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/overview.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/overview.html
b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/overview.html
index 0e194ef..72d4b4e 100644
--- a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/overview.html
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/overview.html
@@ -27,45 +27,47 @@
 		<table class="table table-striped hadoopMetric-table">
 			<tr>
 				<td width="5%">
-					<span ng-show="hmasteractivenum">{{hmasteractivenum}}</span>
-					<span ng-show="!hmasteractivenum">N/A</span>
+					<span ng-show="hmasteractivenum !== -1">{{hmasteractivenum || 0}}</span>
+					<span ng-show="hmasteractivenum === -1">N/A</span>
 				</td>
 				<th width="45%">Active HBase Master</th>
 				<td width="5%">
-					<span ng-show="regionsnum">{{regionsnum}}</span>
-					<span ng-show="!regionsnum">N/A</span>
+					<span ng-show="regionsnum !== -1">{{regionsnum || 0}}</span>
+					<span ng-show="regionsnum === -1">N/A</span>
 				</td>
 				<th width="45%">Regions
 				</th>
 			</tr>
 			<tr>
 				<td>
-					<a ui-sref="backupMasterList({siteId: site})">
-						<span ng-show="hmasterstandbynum">{{hmasterstandbynum}}</span></a>
+					<span ng-show="hmasterstandbynum !== -1"><a ui-sref="backupMasterList({siteId:
site})">{{hmasterstandbynum}}</a></span>
 					<span ng-show="!hmasterstandbynum">0</span>
+					<span ng-show="hmasterstandbynum === -1">N/A</span>
 				</td>
 				<th>Backup HBase Master</th>
 				<td>
-					<span ng-show="hmasteraverageload !== '-1'">{{common.number.format(hmasteraverageload,
0)}}</span>
-					<span ng-show="hmasteraverageload === '-1'">N/A</span>
+					<span ng-show="hmasteraverageload !== -1 && hmasteraverageload">{{common.number.format(hmasteraverageload,
0)}}</span>
+					<span ng-show="!hmasteraverageload">0</span>
+					<span ng-show="hmasteraverageload === -1">N/A</span>
 				</td>
 				<th>Average Load</th>
 			</tr>
 			<tr>
 				<td>
 					<a ui-sref="regionList({siteId: site})">
-						<span ng-show="regionserverhealtynum || regionserverunhealtynum">{{regionserverhealtynum+regionserverunhealtynum}}</span></a>
-					<span ng-show="!regionserverhealtynum && !regionserverunhealtynum">N/A</span>
+						<span ng-show="regionserverhealtynum!==-1 && regionserverunhealtynum!==-1">{{regionserverhealtynum+regionserverunhealtynum}}</span></a>
+					<span ng-show="!regionserverhealtynum && !regionserverunhealtynum">0</span>
+					<span ng-show="regionserverhealtynum===-1 || regionserverunhealtynum===-1">N/A</span>
 				</td>
 				<th>RegionServers:
-					<a ui-sref="regionList({siteId: site})">
-						<span ng-show="regionserverhealtynum">{{regionserverhealtynum}}</span></a>
-					<span ng-show="!regionserverhealtynum">0</span>
+                    <span ng-show="regionserverhealtynum!==-1 && regionserverunhealtynum!==-1
&& regionserverhealtynum"><a ui-sref="regionList({siteId: site, status:'live'})">{{regionserverhealtynum}}</a></span>
+                    <span ng-show="!regionserverhealtynum">0</span>
+					<span ng-show="regionserverhealtynum===-1 || regionserverunhealtynum===-1">N/A</span>
 					<span
 					class="label label-success">Good Health</span> /
-					<a ui-sref="regionList({siteId: site})">
-						<span ng-show="regionserverunhealtynum">{{regionserverunhealtynum}}</span></a>
-					    <span ng-show="!regionserverunhealtynum">0</span>
+                    <span ng-show="regionserverhealtynum!==-1 && regionserverunhealtynum!==-1
&& regionserverunhealtynum"><a ui-sref="regionList({siteId: site, status:'dead'})">{{regionserverunhealtynum
|| 0}}</a></span>
+                    <span ng-show="!regionserverunhealtynum">0</span>
+                    <span ng-show="regionserverhealtynum===-1 || regionserverunhealtynum===-1">N/A</span>
 					<span class="label label-danger">Bad Health</span>
 				</th>
 				<td></td>
@@ -88,22 +90,29 @@
 			<div class="col-sm-6 col-md-4 col-lg-6" ng-repeat="chart in chartList track by $index">
 				<div class="hadoopMetric-chart">
 					<h3>{{metricList[chart.name].title}}</h3>
-					<div ng-show="metricList[chart.name].loading" chart class="hadoopMetric-chart-container"></div>
-					<div ng-show="metricList[chart.name].loading" class="overlay-wrapper">
+					<div ng-show="defaultHostname && metricList[chart.name].loading" chart class="hadoopMetric-chart-container"></div>
+					<div ng-show="defaultHostname && metricList[chart.name].loading" class="overlay-wrapper">
 						<div class="overlay">
 							<i class="fa fa-refresh fa-spin"></i>
 						</div>
 					</div>
-					<div ng-show="metricList[chart.name].series.length" chart class="hadoopMetric-chart-container"
+					<div ng-show="defaultHostname && metricList[chart.name].series.length" chart
class="hadoopMetric-chart-container"
 						 series="metricList[chart.name].series"
 						 option="metricList[chart.name].option"></div>
-					<div ng-show="!metricList[chart.name].series.length && !metricList[chart.name].loading"
class="hadoopMetric-chart-container">
+					<div ng-show="defaultHostname && !metricList[chart.name].series.length &&
!metricList[chart.name].loading" class="hadoopMetric-chart-container">
 						<div class="hadoopMetric-chart-container-withborder">
 							<div class="hadoopMetric-no-chart-data">
 								<span class="fa fa-question-circle"></span><span> NO DATA</span>
 							</div>
 						</div>
 					</div>
+					<div ng-show="!defaultHostname" class="hadoopMetric-chart-container">
+						<div class="hadoopMetric-chart-container-withborder">
+							<div class="hadoopMetric-no-chart-data">
+								<span class="fa fa-question-circle"></span><span> N/A</span>
+							</div>
+						</div>
+					</div>
 				</div>
 			</div>
 		</div>

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionDetail.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionDetail.html
b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionDetail.html
index 63a895f..edf33e0 100644
--- a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionDetail.html
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionDetail.html
@@ -57,27 +57,27 @@
 			<tbody ng-if="regionstatus.length === 0">
 			<tr>
 				<th>Status</th>
-				<td class="text-break"><span class="label label-danger">Unknow</span></td>
+				<td class="text-break"><span class="label label-danger">N/A</span></td>
 			</tr>
 			<tr>
 				<th>Rack</th>
-				<td class="text-break"><span class="label label-danger">Unknow</span></td>
+				<td class="text-break"><span class="label label-danger">N/A</span></td>
 			</tr>
 			<tr>
 				<th>MaxHeap</th>
-				<td class="text-break"><span class="label label-danger">Unknow</span></td>
+				<td class="text-break"><span class="label label-danger">N/A</span></td>
 			</tr>
 			<tr>
 				<th>UsedHeap</th>
-				<td class="text-break"><span class="label label-danger">Unknow</span></td>
+				<td class="text-break"><span class="label label-danger">N/A</span></td>
 			</tr>
 			<tr>
 				<th>NumRegions</th>
-				<td class="text-break"><span class="label label-danger">Unknow</span></td>
+				<td class="text-break"><span class="label label-danger">N/A</span></td>
 			</tr>
 			<tr>
 				<th>NumRequests</th>
-				<td class="text-break"><span class="label label-danger">Unknow</span></td>
+				<td class="text-break"><span class="label label-danger">N/A</span></td>
 			</tr>
 			</tbody>
 		</table>

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/widgets/availabilityChart.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/widgets/availabilityChart.js
b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/widgets/availabilityChart.js
index c74dece..08cafaf 100644
--- a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/widgets/availabilityChart.js
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/widgets/availabilityChart.js
@@ -66,21 +66,29 @@
 								$.map(res, function (data) {
 									$scope.hmasteractivenum = data.value[0];
 								});
+							}, function () {
+								$scope.hmasteractivenum = -1;
 							});
 							countHBaseRole(site.siteId, "standby", "hmaster", ["site"], "count")._promise.then(function
(res) {
 								$.map(res, function (data) {
 									$scope.hmasterstandbynum = data.value[0];
 								});
+							}, function () {
+								$scope.hmasterstandbynum = -1;
 							});
 							countHBaseRole(site.siteId, "live", "regionserver", ["site"], "count")._promise.then(function
(res) {
 								$.map(res, function (data) {
 									$scope.regionserverhealtynum = data.value[0];
 								});
+							}, function () {
+								$scope.regionserverhealtynum = -1;
 							});
 							countHBaseRole(site.siteId, "dead", "regionserver", ["site"], "count")._promise.then(function
(res) {
 								$.map(res, function (data) {
 									$scope.regionserverunhealtynum = data.value[0];
 								});
+							}, function () {
+								$scope.regionserverunhealtynum = -1;
 							});
 						});
 					}
@@ -96,22 +104,39 @@
 				'<div class="small-box hadoopMetric-widget bg-{{bgColor}}">' +
 				    '<div class="inner">' +
 				        '<h3>{{type}}</h3>' +
-				        '<div ng-show="hmasteractivenum" class="hadoopMetric-widget-detail">' +
-					        '<a ui-sref="HBaseMetric({siteId: site.siteId})">' +
+				        '<div ng-show="hmasteractivenum!==-1 && hmasterstandbynum!==-1" class="hadoopMetric-widget-detail">'
+
+					        '<a ng-show="hmasteractivenum || hmasterstandbynum" ui-sref="HBaseMetric({siteId:
site.siteId})">' +
 				            '<span>{{hmasteractivenum+hmasterstandbynum}}</span> Masters
(' +
-				            '<span ng-show="hmasteractivenum">{{hmasteractivenum}}</span><span
ng-show="!hmasteractivenum">0</span> Active / ' +
-				            '<span ng-show="hmasterstandbynum">{{hmasterstandbynum}}</span><span
ng-show="!hmasterstandbynum">0</span> Standby)' +
+				            '<span>{{hmasteractivenum || 0}}</span> Active / ' +
+				            '<span>{{hmasterstandbynum || 0}}</span> Standby)' +
 					        '</a>' +
+				            '<div ng-show="!hmasteractivenum && !hmasterstandbynum">' +
+				            '<span>0</span> Masters (' +
+				            '<span>0</span> Active / ' +
+				            '<span>0</span> Standby)' +
+				            '</div>' +
 				        '</div>' +
-				        '<div ng-show="!hmasteractivenum" class="hadoopMetric-widget-detail">'
+
-				           '<span class="fa fa-question-circle"></span><span> NO DATA</span>'
+
+				        '<div ng-show="hmasteractivenum===-1 || hmasterstandbynum===-1" class="hadoopMetric-widget-detail">'
+
+				        '<span>N/A</span> Masters (' +
+				        '<span>N/A</span> Active / ' +
+				        '<span>N/A</span> Standby)' +
 				        '</div>' +
-				        '<div ng-show="hmasteractivenum" class="hadoopMetric-widget-detail">' +
-				            '<a ui-sref="regionList({siteId: site.siteId})">' +
+				        '<div ng-show="regionserverhealtynum!==-1 && regionserverunhealtynum!==-1"
class="hadoopMetric-widget-detail">' +
+				            '<a ng-show="regionserverhealtynum || regionserverunhealtynum" ui-sref="regionList({siteId:
site.siteId})">' +
 				            '<span>{{regionserverhealtynum+regionserverunhealtynum}}</span>
RegionServers (' +
-				            '<span ng-show="regionserverhealtynum">{{regionserverhealtynum}}</span><span
ng-show="!regionserverhealtynum">0</span> Healthy / ' +
-				            '<span ng-show="regionserverunhealtynum">{{regionserverunhealtynum}}</span><span
ng-show="!regionserverunhealtynum">0</span> Unhealthy)' +
+				            '<span>{{regionserverhealtynum || 0}}</span> Healthy / ' +
+				            '<span>{{regionserverunhealtynum || 0}}</span> Unhealthy)' +
 				            '</a>' +
+				            '<div ng-show="!regionserverhealtynum && !regionserverunhealtynum">'
+
+				            '<span>0</span> Masters (' +
+				            '<span>0</span> Active / ' +
+				            '<span>0</span> Standby)' +
+				            '</div>' +
+				        '</div>' +
+				        '<div ng-show="regionserverhealtynum===-1 || regionserverunhealtynum===-1"
class="hadoopMetric-widget-detail">' +
+				        '<span>N/A</span> RegionServers (' +
+				        '<span>N/A</span> Healthy / ' +
+				        '<span>N/A</span> Unhealthy)' +
 				        '</div>' +
 				    '</div>' +
 				    '<div class="icon">' +

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/datanodeListCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/datanodeListCtrl.js
b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/datanodeListCtrl.js
index aee0536..78ea7e1 100644
--- a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/datanodeListCtrl.js
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/datanodeListCtrl.js
@@ -30,8 +30,10 @@
 			$scope.live = HDFSMETRIC.STATUS_LIVE;
 			$scope.dead = HDFSMETRIC.STATUS_DEAD;
 			$scope.site = $wrapState.param.siteId;
+			$scope.status = $wrapState.param.status;
 			$scope.searchPathList = [["tags", "hostname"], ["tags", "rack"], ["tags", "site"], ["status"]];
-			$scope.datanodeList = HDFSMETRIC.getListByRoleName("HdfsServiceInstance", "datanode",
$scope.site);
+			$scope.datanodeList = (typeof $scope.status === 'undefined') ? HDFSMETRIC.getListByRoleName("HdfsServiceInstance",
"datanode", $scope.site)
+			   : HDFSMETRIC.getHadoopHostByStatusAndRole("HdfsServiceInstance", $scope.site, $scope.status,
"datanode");
 
 		});
 	});

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/namenodeListCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/namenodeListCtrl.js
b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/namenodeListCtrl.js
index 3e4ea41..8424b8e 100644
--- a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/namenodeListCtrl.js
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/namenodeListCtrl.js
@@ -28,8 +28,10 @@
 			PageConfig.title = "HDFS Namenode List";
 			$scope.tableScope = {};
 			$scope.site = $wrapState.param.siteId;
+			$scope.status = $wrapState.param.status;
 			$scope.searchPathList = [["tags", "hostname"], ["tags", "rack"], ["tags", "site"], ["status"]];
-			$scope.namenodeList = HDFSMETRIC.getListByRoleName("HdfsServiceInstance", "namenode",
$scope.site);
+			$scope.namenodeList = (typeof $scope.status === 'undefined') ? HDFSMETRIC.getListByRoleName("HdfsServiceInstance",
"namenode", $scope.site)
+				: HDFSMETRIC.getHadoopHostByStatusAndRole("HdfsServiceInstance", $scope.site, $scope.status,
"namenode");
 		});
 	});
 })();

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/overview.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/overview.js b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/overview.js
index d77986a..dd5792e 100644
--- a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/overview.js
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/overview.js
@@ -87,15 +87,19 @@
 					}
 				}]
 			};
-			var startTime = Time.startTime();
-			var endTime = Time.endTime();
-			var interval = Time.diffInterval(startTime, endTime);
-			var intervalMin = interval / 1000 / 60;
-			var trendStartTime = Time.align(startTime, interval);
-			var trendEndTime = Time.align(endTime, interval);
-			$scope.site = $wrapState.param.siteId;
+
 			function generateHdfsMetric(name, flag) {
+				var startTime = Time.startTime();
+				var endTime = Time.endTime();
+				var interval = Time.diffInterval(startTime, endTime);
+				var intervalMin = interval / 1000 / 60;
+				var trendStartTime = Time.align(startTime, interval);
+				var trendEndTime = Time.align(endTime, interval);
+				$scope.site = $wrapState.param.siteId;
 				var result = cache[name] || namenodeInfo._promise.then(function (res) {
+						if(typeof res[0] === 'undefined' || res.length === 0) {
+							return [];
+						}
 						$scope.activeNamenodeList = res;
 						$scope.type = $wrapState.param.hostname || $scope.namenode || res[0].tags.hostname;
 						var hostname = $scope.namenode || res[0].tags.hostname;
@@ -237,7 +241,7 @@
 							var series = [];
 							for(var r=0; r < resp.length; r+=1) {
 								var rs = resp[r][1];
-								if(rs.length > 0) {
+								if (typeof rs !== 'undefined' && rs.length > 0) {
 									series.push(rs);
 								}
 							}
@@ -250,36 +254,59 @@
 					$.map(res, function (data) {
 						$scope.namenodeactivenum = data.value[0];
 					});
-				});
+				}, function () {
+                    $scope.namenodeactivenum = -1;
+                });
 				HDFSMETRIC.countHadoopRole("HdfsServiceInstance", $scope.site, "standby", "namenode",
["site"], "count")._promise.then(function (res) {
 					$.map(res, function (data) {
 						$scope.namenodestandbynum = data.value[0];
 					});
-				});
+				}, function () {
+                    $scope.namenodestandbynum = -1;
+                });
 				HDFSMETRIC.countHadoopRole("HdfsServiceInstance", $scope.site, "live", "datanode", ["site"],
"count")._promise.then(function (res) {
 					$.map(res, function (data) {
 						$scope.datanodehealtynum = data.value[0];
 					});
-				});
+				}, function () {
+                    $scope.datanodehealtynum = -1;
+                });
 				HDFSMETRIC.countHadoopRole("HdfsServiceInstance", $scope.site, "dead", "datanode", ["site"],
"count")._promise.then(function (res) {
 					$.map(res, function (data) {
 						$scope.datanodeunhealtynum = data.value[0];
 					});
-				});
+				}, function () {
+                    $scope.datanodeunhealtynum = -1;
+                });
 				sumMetrics($scope.site, "datanode", ["site"], "sum(configuredCapacityTB)")._promise.then(function
(res) {
 					$.map(res, function (data) {
 						$scope.capacityNum = data.value[0];
 					});
-				});
+				}, function () {
+                    $scope.capacityNum = -1;
+                });
 				sumMetrics($scope.site, "datanode", ["site"], "sum(usedCapacityTB)")._promise.then(function
(res) {
 					$.map(res, function (data) {
 						$scope.usedCapacityNum = data.value[0];
 					});
-				});
+				}, function () {
+                    $scope.usedCapacityNum = -1;
+                });
 			};
 
 			Time.onReload(function () {
 				cache = {};
+				$.each($scope.chartList, function (i) {
+					var chart = $scope.chartList[i];
+					var chartname = chart.name;
+					$scope.metricList[chartname] = {
+						title: chartname,
+						series: {},
+						option: {},
+						loading: true,
+						promises: []
+					};
+				});
 				$scope.refresh();
 			}, $scope);
 			$scope.refresh();

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.js b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.js
index a4d6576..fb64d4e 100644
--- a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.js
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.js
@@ -35,12 +35,12 @@
 		controller: "datanodeDetailCtrl",
 		resolve: {time: true}
 	}).route("datanodeList", {
-		url: "/hadoopService/hdfs/datanodeList",
+		url: "/hadoopService/hdfs/datanodeList?status",
 		site: true,
 		templateUrl: "partials/datanodeList.html",
 		controller: "datanodeListCtrl"
 	}).route("namenodeList", {
-		url: "/hadoopService/hdfs/namenodeList",
+		url: "/hadoopService/hdfs/namenodeList?status",
 		site: true,
 		templateUrl: "partials/namenodeList.html",
 		controller: "namenodeListCtrl"
@@ -250,6 +250,8 @@
 				});
 				_list.done = true;
 				return _list;
+			}, function () {
+				return [];
 			});
 			return _list;
 		};
@@ -265,13 +267,13 @@
 			return wrapList(HDFSMETRIC.get(metrics_url));
 		};
 
-		HDFSMETRIC.getHadoopHostByStatusAndRole = function (service, siteId, status,role, limit)
{
+		HDFSMETRIC.getHadoopHostByStatusAndRole = function (service, siteId, status,role) {
 			var condition = {
 				site: siteId,
 				role: role,
 				status: status
 			};
-			return HDFSMETRIC.hadoopHostStatus(service, condition, limit);
+			return HDFSMETRIC.hadoopHostStatus(service, condition);
 		};
 
 		HDFSMETRIC.getStatusByRoleAndHost = function (service, hostname, role, siteid) {

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/datanodeList.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/datanodeList.html
b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/datanodeList.html
index 0a31b9e..b76d44d 100644
--- a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/datanodeList.html
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/datanodeList.html
@@ -28,7 +28,7 @@
 			<table class="table table-bordered">
 				<thead>
 				<tr>
-					<th sortpath="tags.hostname">RegionServer</th>
+					<th sortpath="tags.hostname">Datanode</th>
 					<th sortpath="tags.rack">Rack</th>
 					<th sortpath="tags.site">SiteId</th>
 					<th sortpath="status">Status</th>

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/overview.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/overview.html
b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/overview.html
index 328b869..7a6d9ad 100644
--- a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/overview.html
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/overview.html
@@ -27,16 +27,18 @@
         <table class="table table-striped hadoopMetric-table">
             <tr>
                 <td width="5%">
-                    <a ui-sref="namenodeList({siteId: site})" target="_blank">
-                        <span ng-show="namenodeactivenum">{{namenodeactivenum}}</span></a>
-                    <span ng-show="!namenodeactivenum">N/A</span>
+                    <span ng-show="!namenodeactivenum">0</span>
+                    <span ng-show="namenodeactivenum!==-1"><a ui-sref="namenodeList({siteId:
site, status: 'active'})" target="_blank">{{namenodeactivenum}}</a></span>
+                    <span ng-show="namenodeactivenum===-1">N/A</span>
                 </td>
                 <th width="30%">Active Namenode</th>
                 <td>
-                    <span ng-show="capacityNum">{{common.number.format(capacityNum,
0)}} TB</span>
-                    <span ng-show="!capacityNum">N/A</span>
-                    Capacity <span ng-show="usedCapacityNum">{{common.number.format(usedCapacityNum,
0)}} TB</span>
-                    <span ng-show="!usedCapacityNum">N/A</span> usedCapacity
+                    <span ng-show="capacityNum!==-1 && capacityNum">{{common.number.format(capacityNum,
0)}}</span>
+                    <span ng-show="!capacityNum">0</span>
+                    <span ng-show="capacityNum===-1">N/A</span> TB
+                    <strong>Capacity</strong> <span ng-show="usedCapacityNum!==-1
&& usedCapacityNum">{{common.number.format(usedCapacityNum, 0)}}</span>
+                    <span ng-show="!usedCapacityNum">0</span>
+                    <span ng-show="usedCapacityNum===-1">N/A</span> TB <strong>usedCapacity</strong>
 
                 </td>
                 <th width="30%">
@@ -44,26 +46,26 @@
             </tr>
             <tr>
                 <td>
-                    <a ui-sref="namenodeList({siteId: site})" target="_blank">
-                        <span ng-show="namenodestandbynum">{{namenodestandbynum}}</span></a>
-                    <span ng-show="!namenodestandbynum">N/A</span>
+                    <span ng-show="namenodestandbynum!==-1"><a ui-sref="namenodeList({siteId:
site, status: 'standby'})" target="_blank">{{namenodestandbynum}}</a></span>
+                    <span ng-show="!namenodestandbynum">0</span>
+                    <span ng-show="namenodestandbynum===-1">N/A</span>
                 </td>
                 <th>Backup Namenode</th>
             </tr>
             <tr>
                 <td>
-                    <a ui-sref="datanodeList({siteId: site})">
-                        <span ng-show="datanodehealtynum || datanodeunhealtynum">{{datanodehealtynum+datanodeunhealtynum}}</span></a>
-                    <span ng-show="!datanodehealtynum && !datanodeunhealtynum">N/A</span>
+                    <span ng-show="datanodehealtynum!==-1 && datanodeunhealtynum!==-1"><a
ui-sref="datanodeList({siteId: site})">{{datanodehealtynum+datanodeunhealtynum}}</a></span>
+                    <span ng-show="!datanodehealtynum && !datanodeunhealtynum">0</span>
+                    <span ng-show="datanodehealtynum===-1 || datanodeunhealtynum===-1">N/A</span>
                 </td>
                 <th>Datanodes:
-                    <span ng-show="datanodehealtynum">{{datanodehealtynum}}</span>
-                    <span ng-show="!datanodehealtynum">N/A</span>
-                    <span
-                            class="label label-success">Good Health</span> /
-                    <a ui-sref="datanodeList({siteId: site})">
-                        <span ng-show="datanodeunhealtynum">{{datanodeunhealtynum}}</span></a>
+                    <span ng-show="datanodehealtynum!==-1 && datanodeunhealtynum!==-1
&& datanodehealtynum"><a ui-sref="datanodeList({siteId: site, status: 'live'})">{{datanodehealtynum
|| 0}}</a></span>
+                    <span ng-show="!datanodehealtynum">0</span>
+                    <span ng-show="datanodehealtynum===-1 || datanodeunhealtynum===-1">N/A</span>
+                    <span class="label label-success">Good Health</span> /
+                    <span ng-show="datanodehealtynum!==-1 && datanodeunhealtynum!==-1
&& datanodeunhealtynum"><a ui-sref="datanodeList({siteId: site, status: 'dead'})">{{datanodeunhealtynum
|| 0}}</a></span>
                     <span ng-show="!datanodeunhealtynum">0</span>
+                    <span ng-show="datanodehealtynum===-1 || datanodeunhealtynum===-1">N/A</span>
                     <span class="label label-danger">Bad Health</span>
                 </th>
                 <td></td>
@@ -95,20 +97,29 @@
                         <div class="col-sm-6 col-md-4 col-lg-6" ng-repeat="chart in chartList
track by $index">
                             <div class="hadoopMetric-chart">
                                 <h3>{{metricList[chart.name].title}}</h3>
-                                <div ng-show="metricList[chart.name].loading"
-                                     class="fa fa-refresh fa-spin no-animate"></div>
-                                <div ng-show="metricList[chart.name].series.length" chart
-                                     class="hadoopMetric-chart-container"
+                                <div ng-show="activeNamenodeList && metricList[chart.name].loading"
chart class="hadoopMetric-chart-container"></div>
+                                <div ng-show="activeNamenodeList && metricList[chart.name].loading"
class="overlay-wrapper">
+                                    <div class="overlay">
+                                        <i class="fa fa-refresh fa-spin"></i>
+                                    </div>
+                                </div>
+                                <div ng-show="activeNamenodeList && metricList[chart.name].series.length"
chart class="hadoopMetric-chart-container"
                                      series="metricList[chart.name].series"
                                      option="metricList[chart.name].option"></div>
-                                <div ng-show="!metricList[chart.name].series.length &&
!metricList[chart.name].loading"
-                                     class="hadoopMetric-chart-container">
+                                <div ng-show="activeNamenodeList && !metricList[chart.name].series.length
&& !metricList[chart.name].loading" class="hadoopMetric-chart-container">
                                     <div class="hadoopMetric-chart-container-withborder">
                                         <div class="hadoopMetric-no-chart-data">
                                             <span class="fa fa-question-circle"></span><span>
NO DATA</span>
                                         </div>
                                     </div>
                                 </div>
+                                <div ng-show="!activeNamenodeList" class="hadoopMetric-chart-container">
+                                    <div class="hadoopMetric-chart-container-withborder">
+                                        <div class="hadoopMetric-no-chart-data">
+                                            <span class="fa fa-question-circle"></span><span>
N/A</span>
+                                        </div>
+                                    </div>
+                                </div>
                             </div>
                         </div>
                     </div>

http://git-wip-us.apache.org/repos/asf/eagle/blob/97ae1da5/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/widget/availabilityChart.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/widget/availabilityChart.js
b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/widget/availabilityChart.js
index 6653438..e0df1a8 100644
--- a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/widget/availabilityChart.js
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/widget/availabilityChart.js
@@ -55,21 +55,29 @@
 								$.map(res, function (data) {
 									$scope.namenodeactivenum = data.value[0];
 								});
+							}, function () {
+								$scope.namenodeactivenum = -1;
 							});
 							HDFSMETRIC.countHadoopRole("HdfsServiceInstance", site.siteId, "standby", "namenode",
["site"], "count")._promise.then(function (res) {
 								$.map(res, function (data) {
 									$scope.namenodestandbynum = data.value[0];
 								});
+							}, function () {
+								$scope.namenodestandbynum = -1;
 							});
 							HDFSMETRIC.countHadoopRole("HdfsServiceInstance", site.siteId, "live", "datanode",
["site"], "count")._promise.then(function (res) {
 								$.map(res, function (data) {
 									$scope.datanodehealtynum = data.value[0];
 								});
+							}, function () {
+								$scope.datanodehealtynum = -1;
 							});
 							HDFSMETRIC.countHadoopRole("HdfsServiceInstance", site.siteId, "dead", "datanode",
["site"], "count")._promise.then(function (res) {
 								$.map(res, function (data) {
 									$scope.datanodeunhealtynum = data.value[0];
 								});
+							}, function () {
+								$scope.datanodeunhealtynum = -1;
 							});
 						});
 					}
@@ -85,22 +93,39 @@
 				'<div class="small-box hadoopMetric-widget bg-{{bgColor}}">' +
 				'<div class="inner">' +
 				'<h3>{{type}}</h3>' +
-				'<div ng-show="namenodeactivenum" class="hadoopMetric-widget-detail">' +
-				'<a ui-sref="namenodeList({siteId: site.siteId})">' +
+				'<div ng-show="namenodeactivenum!==-1 && namenodestandbynum!==-1" class="hadoopMetric-widget-detail">'
+
+				'<a ng-show="namenodeactivenum || namenodestandbynum" ui-sref="namenodeList({siteId:
site.siteId})">' +
 				'<span>{{namenodeactivenum+namenodestandbynum}}</span> Namenodes (' +
-				'<span ng-show="namenodeactivenum">{{namenodeactivenum}}</span><span ng-show="!namenodeactivenum">0</span>
Active / ' +
-				'<span ng-show="namenodestandbynum">{{namenodestandbynum}}</span><span
ng-show="!namenodestandbynum">0</span> Standby)' +
+				'<span>{{namenodeactivenum||0}}</span> Active / ' +
+				'<span>{{namenodestandbynum||0}}</span> Standby)' +
 				'</a>' +
+				'<div ng-show="!namenodeactivenum && !namenodestandbynum">' +
+				'<span>0</span> Masters (' +
+				'<span>0</span> Active / ' +
+				'<span>0</span> Standby)' +
 				'</div>' +
-				'<div ng-show="!namenodeactivenum" class="hadoopMetric-widget-detail">' +
-				'<span class="fa fa-question-circle"></span><span> NO DATA</span>'
+
 				'</div>' +
-				'<div ng-show="namenodeactivenum" class="hadoopMetric-widget-detail">' +
-				'<a ui-sref="datanodeList({siteId: site.siteId})">' +
+				'<div ng-show="namenodeactivenum===-1 || namenodestandbynum===-1" class="hadoopMetric-widget-detail">'
+
+				'<span>N/A</span> Namenodes (' +
+				'<span>N/A</span> Active / ' +
+				'<span>N/A</span> Standby)' +
+				'</div>' +
+				'<div ng-show="datanodehealtynum!==-1 && datanodeunhealtynum!==-1" class="hadoopMetric-widget-detail">'
+
+				'<a ng-show="datanodehealtynum || datanodeunhealtynum" ui-sref="datanodeList({siteId:
site.siteId})">' +
 				'<span>{{datanodehealtynum+datanodeunhealtynum}}</span> Datanodes (' +
-				'<span ng-show="datanodehealtynum">{{datanodehealtynum}}</span><span ng-show="!datanodehealtynum">0</span>
Healthy / ' +
-				'<span ng-show="datanodeunhealtynum">{{datanodeunhealtynum}}</span><span
ng-show="!datanodeunhealtynum">0</span> Unhealthy)' +
+				'<span>{{datanodehealtynum||0}}</span> Healthy / ' +
+				'<span>{{datanodeunhealtynum||0}}</span> Unhealthy)' +
 				'</a>' +
+				'<div ng-show="!datanodehealtynum && !datanodehealtynum">' +
+				'<span>0</span> Masters (' +
+				'<span>0</span> Active / ' +
+				'<span>0</span> Standby)' +
+				'</div>' +
+				'</div>' +
+				'<div ng-show="datanodehealtynum===-1 || datanodeunhealtynum===-1" class="hadoopMetric-widget-detail">'
+
+				'<span>N/A</span> Datanodes (' +
+				'<span>N/A</span> Healthy / ' +
+				'<span>N/A</span> Unhealthy)' +
 				'</div>' +
 				'</div>' +
 				'<div class="icon">' +


Mime
View raw message