Repository: ambari
Updated Branches:
  refs/heads/trunk e30a3c086 -> 234438442


AMBARI-16724 Allow customizing Connection Timeout for METRIC Alerts (zhewang)


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

Branch: refs/heads/trunk
Commit: 2344384421465e5dae3ae418bc985f9af60199b2
Parents: e30a3c0
Author: Zhe (Joe) Wang <[email protected]>
Authored: Thu May 19 00:58:29 2016 -0400
Committer: Zhe (Joe) Wang <[email protected]>
Committed: Thu May 19 00:58:29 2016 -0400

----------------------------------------------------------------------
 .../main/alerts/definition_configs_controller.js       | 13 +++++++++++++
 .../main/alerts/definitions_configs_controller_test.js |  7 ++++---
 2 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/23443844/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js 
b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
index 617f7cc..b58ced9 100644
--- a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
+++ b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
@@ -254,6 +254,19 @@ App.MainAlertDefinitionConfigsController = 
Em.Controller.extend({
         valueMetric: units,
         text: isWizard ? '' : this.getThresholdsProperty('critical', 'text'),
         value: isWizard ? '' : this.getThresholdsProperty('critical', 'value')
+      }),
+      App.AlertConfigProperties.Parameter.create({
+        value: alertDefinition.get('uri.connectionTimeout'),
+        threshold: "CRITICAL",
+        name: 'connection_timeout',
+        label: 'Connection Timeout',
+        displayType: 'parameter',
+        apiProperty: 'source.uri.connection_timeout',
+        units: 'Seconds',
+        isValid: function () {
+          var value = this.get('value');
+          return numericUtils.isPositiveNumber(value);
+        }.property('value')
       })
     ]);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/23443844/ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js
 
b/ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js
index f3cf28c..2ea42f7 100644
--- 
a/ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js
+++ 
b/ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js
@@ -163,7 +163,8 @@ describe('App.MainAlertDefinitionConfigsController', 
function () {
           "https": "{{mapred-site/mapreduce.jobhistory.webapp.https.address}}",
           "https_property": "{{mapred-site/mapreduce.jobhistory.http.policy}}",
           "https_property_value": "HTTPS_ONLY",
-          "default_port": 0.0
+          "default_port": 0.0,
+          "connection_timeout": 123
         },
         jmx: {
           propertyList: ['property1', 'property2'],
@@ -179,13 +180,13 @@ describe('App.MainAlertDefinitionConfigsController', 
function () {
     it('isWizard = true', function () {
       controller.set('isWizard', true);
       var result = controller.renderMetricConfigs();
-      expect(result.length).to.equal(11);
+      expect(result.length).to.equal(12);
     });
 
     it('isWizard = false', function () {
       controller.set('isWizard', false);
       var result = controller.renderMetricConfigs();
-      expect(result.length).to.equal(5);
+      expect(result.length).to.equal(6);
     });
 
   });

Reply via email to