From 62ab13d3198497925bd7f54e52f04ca788b0e1ad Mon Sep 17 00:00:00 2001 From: chitin Date: Thu, 23 Feb 2017 15:42:42 +0800 Subject: [PATCH 1/2] [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 --- .../webapp/app/apps/hbase/ctrls/overview.js | 55 +++++++++++++---- .../app/apps/hbase/ctrls/regionListCtrl.js | 4 +- .../src/main/webapp/app/apps/hbase/index.js | 23 +++++-- .../app/apps/hbase/partials/overview.html | 49 +++++++++------ .../apps/hbase/widgets/availabilityChart.js | 31 +++++++--- .../app/apps/hdfs/ctrl/datanodeListCtrl.js | 4 +- .../app/apps/hdfs/ctrl/namenodeListCtrl.js | 4 +- .../webapp/app/apps/hdfs/ctrl/overview.js | 53 ++++++++++++---- .../src/main/webapp/app/apps/hdfs/index.js | 8 +-- .../app/apps/hdfs/partials/datanodeList.html | 2 +- .../app/apps/hdfs/partials/overview.html | 61 +++++++++++-------- .../app/apps/hdfs/widget/availabilityChart.js | 31 +++++++--- 12 files changed, 224 insertions(+), 101 deletions(-) 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 6e7df0bc4e..f17e12cb6f 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,10 @@ $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].tags === 'undefined') { + return; + } + var hostname = res[0].tags.hostname; $scope.defaultHostname = $wrapState.param.hostname || hostname; var jobCond = { @@ -252,44 +255,72 @@ $.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].tags === 'undefined') { + $scope.hmasteraverageload = -1; + } else { + 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(); 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 1477e32a6c..6fc9ab0d72 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); }); }); })(); 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 c6b5135bb1..98d03c950b 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" @@ -300,12 +300,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; }; 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 0e194ef8fb..72d4b4e47e 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 @@

@@ -88,22 +90,29 @@

{{metricList[chart.name].title}}

-
-
+
+
-
-
+
NO DATA
+
+
+
+ N/A +
+
+
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 c74decea2e..397a142551 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,23 +104,30 @@ '
' + '
' + '

{{type}}

' + - '
' + + '' + - '
' + - ' NO DATA' + + '
' + + 'N/A Masters (' + + 'N/A Active / ' + + 'N/A Standby)' + '
' + - '' + '
' + '' + 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 aee0536bb2..78ea7e13ad 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"); }); }); 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 3e4ea41bbb..8424b8e06a 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"); }); }); })(); 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 d77986aa97..f71051f665 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].tags === 'undefined') { + return; + } $scope.activeNamenodeList = res; $scope.type = $wrapState.param.hostname || $scope.namenode || res[0].tags.hostname; var hostname = $scope.namenode || res[0].tags.hostname; @@ -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(); 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 a4d6576a8b..15f9f76177 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" @@ -265,13 +265,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) { 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 0a31b9ef12..b76d44d9aa 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 @@

- {{hmasteractivenum}} - N/A + {{hmasteractivenum || 0}} + N/A Active HBase Master - {{regionsnum}} - N/A + {{regionsnum || 0}} + N/A Regions
- - {{hmasterstandbynum}} + {{hmasterstandbynum}} 0 + N/A Backup HBase Master - {{common.number.format(hmasteraverageload, 0)}} - N/A + {{common.number.format(hmasteraverageload, 0)}} + 0 + N/A Average Load
- {{regionserverhealtynum+regionserverunhealtynum}} - N/A + {{regionserverhealtynum+regionserverunhealtynum}} + 0 + N/A RegionServers: - - {{regionserverhealtynum}} - 0 + {{regionserverhealtynum}} + 0 + N/A Good Health / - - {{regionserverunhealtynum}} - 0 + {{regionserverunhealtynum || 0}} + 0 + N/A Bad Health
- + 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 328b86927e..7a6d9ad41c 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 @@

RegionServerDatanode Rack SiteId Status
@@ -95,20 +97,29 @@

{{metricList[chart.name].title}}

-
-
+
+
+ +
+
+
-
+
NO DATA
+
+
+
+ N/A +
+
+
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 6653438127..b1e81cf384 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,23 +93,30 @@ '
' + '
' + '

{{type}}

' + - '
' + + '' + - '
' + - ' NO DATA' + + '
' + + 'N/A Namenodes (' + + 'N/A Active / ' + + 'N/A Standby)' + '
' + - '' + '
' + '' + From 04f0a670ed9543bbcb1ca942b28219f617b9ebb0 Mon Sep 17 00:00:00 2001 From: chitin Date: Tue, 28 Feb 2017 10:57:27 +0800 Subject: [PATCH 2/2] - Solve some exception threw from console. - Fix some display problem to make ui more meaningful. --- .../main/webapp/app/apps/hbase/ctrls/overview.js | 11 +++++------ .../src/main/webapp/app/apps/hbase/index.js | 2 ++ .../apps/hbase/partials/region/regionDetail.html | 12 ++++++------ .../app/apps/hbase/widgets/availabilityChart.js | 14 ++++++++++++-- .../src/main/webapp/app/apps/hdfs/ctrl/overview.js | 6 +++--- .../src/main/webapp/app/apps/hdfs/index.js | 2 ++ .../app/apps/hdfs/widget/availabilityChart.js | 14 ++++++++++++-- 7 files changed, 42 insertions(+), 19 deletions(-) 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 f17e12cb6f..2416e631f1 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,9 +59,10 @@ $scope.site = $wrapState.param.siteId; var result = cache[name] || activeMasterInfo._promise.then(function (res) { - if(typeof res[0].tags === 'undefined') { - return; + if(typeof res[0] === 'undefined' || res.length === 0) { + return []; } + var hostname = res[0].tags.hostname; $scope.defaultHostname = $wrapState.param.hostname || hostname; @@ -242,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); } } @@ -288,9 +289,7 @@ }); activeMasterInfo._promise.then(function (res) { - if(typeof res[0].tags === 'undefined') { - $scope.hmasteraverageload = -1; - } else { + 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 = { 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 98d03c950b..8e4ea463b7 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 @@ -265,6 +265,8 @@ }); _list.done = true; return _list; + }, function () { + return []; }); return _list; }; 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 63a895f263..edf33e072a 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 @@

- + - + - + - + - + - +
- - {{namenodeactivenum}} - N/A + 0 + {{namenodeactivenum}} + N/A Active Namenode - {{common.number.format(capacityNum, 0)}} TB - N/A - Capacity {{common.number.format(usedCapacityNum, 0)}} TB - N/A usedCapacity + {{common.number.format(capacityNum, 0)}} + 0 + N/A TB + Capacity {{common.number.format(usedCapacityNum, 0)}} + 0 + N/A TB usedCapacity @@ -44,26 +46,26 @@

- - {{namenodestandbynum}} - N/A + {{namenodestandbynum}} + 0 + N/A Backup Namenode
- - {{datanodehealtynum+datanodeunhealtynum}} - N/A + {{datanodehealtynum+datanodeunhealtynum}} + 0 + N/A Datanodes: - {{datanodehealtynum}} - N/A - Good Health / - - {{datanodeunhealtynum}} + {{datanodehealtynum || 0}} + 0 + N/A + Good Health / + {{datanodeunhealtynum || 0}} 0 + N/A Bad Health
StatusUnknowN/A
RackUnknowN/A
MaxHeapUnknowN/A
UsedHeapUnknowN/A
NumRegionsUnknowN/A
NumRequestsUnknowN/A
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 397a142551..08cafaf4bd 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 @@ -105,11 +105,16 @@ '
' + '

{{type}}

' + '' + '
' + 'N/A Masters (' + @@ -117,11 +122,16 @@ 'N/A Standby)' + '
' + '' + '
' + 'N/A RegionServers (' + 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 f71051f665..dd5792e471 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 @@ -97,8 +97,8 @@ var trendEndTime = Time.align(endTime, interval); $scope.site = $wrapState.param.siteId; var result = cache[name] || namenodeInfo._promise.then(function (res) { - if(typeof res[0].tags === 'undefined') { - return; + if(typeof res[0] === 'undefined' || res.length === 0) { + return []; } $scope.activeNamenodeList = res; $scope.type = $wrapState.param.hostname || $scope.namenode || res[0].tags.hostname; @@ -241,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); } } 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 15f9f76177..fb64d4ed1a 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 @@ -250,6 +250,8 @@ }); _list.done = true; return _list; + }, function () { + return []; }); return _list; }; 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 b1e81cf384..e0df1a8074 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 @@ -94,11 +94,16 @@ '
' + '

{{type}}

' + '' + '
' + 'N/A Namenodes (' + @@ -106,11 +111,16 @@ 'N/A Standby)' + '
' + '' + '
' + 'N/A Datanodes (' +