You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2015/02/03 22:56:50 UTC
ambari git commit: AMBARI-9465. 2 hive metastore stopped alert shown
on service page not showing correct number after run service checks
Repository: ambari
Updated Branches:
refs/heads/trunk fcdbadd59 -> 45d67f60f
AMBARI-9465. 2 hive metastore stopped alert shown on service page not showing correct number after run service checks
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/45d67f60
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/45d67f60
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/45d67f60
Branch: refs/heads/trunk
Commit: 45d67f60f40d692cb28a5cbc1f6546b4107bb8a8
Parents: fcdbadd
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Tue Feb 3 13:50:29 2015 -0800
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Tue Feb 3 13:50:55 2015 -0800
----------------------------------------------------------------------
.../main/alert_definitions_controller.js | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/45d67f60/ambari-web/app/controllers/main/alert_definitions_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/alert_definitions_controller.js b/ambari-web/app/controllers/main/alert_definitions_controller.js
index 8a13945..5c70a60 100644
--- a/ambari-web/app/controllers/main/alert_definitions_controller.js
+++ b/ambari-web/app/controllers/main/alert_definitions_controller.js
@@ -95,8 +95,7 @@ App.MainAlertDefinitionsController = Em.ArrayController.extend({
* @return {number}
*/
getCriticalAlertsCountForService: function (service) {
- var alertsForService = this.get('content').filterProperty('service', service);
- return alertsForService.filterProperty('isCritical').get('length');
+ return this.get('criticalAlertInstances').filterProperty('service', service).get('length');
},
/**
@@ -105,8 +104,7 @@ App.MainAlertDefinitionsController = Em.ArrayController.extend({
* @return {number}
*/
getCriticalOrWarningAlertsCountForService: function (service) {
- var alertsForService = this.get('content').filterProperty('service', service);
- return alertsForService.filterProperty('isCriticalOrWarning').get('length');
+ return this.get('unhealthyAlertInstances').filterProperty('service', service).get('length');
},
/**
@@ -121,12 +119,18 @@ App.MainAlertDefinitionsController = Em.ArrayController.extend({
return this.get('unhealthyAlertInstances.length');
}.property('unhealthyAlertInstances.length'),
- unhealthyAlertInstances: function () {
- return App.AlertInstance.find().toArray().filterProperty('state', 'CRITICAL').concat(
- App.AlertInstance.find().toArray().filterProperty('state', 'WARNING')
- );
+ criticalAlertInstances: function () {
+ return App.AlertInstance.find().toArray().filterProperty('state', 'CRITICAL');
+ }.property('mapperTimestamp'),
+
+ warningAlertInstances: function () {
+ return App.AlertInstance.find().toArray().filterProperty('state', 'WARNING');
}.property('mapperTimestamp'),
+ unhealthyAlertInstances: function () {
+ return this.get('criticalAlertInstances').concat(this.get('warningAlertInstances'));
+ }.property('criticalAlertInstances', 'warningAlertInstances'),
+
/**
* if critical alerts exist, if true, the alert badge should be red.
*/