Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 8c10a51f6 -> cb69417eb


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/cb69417e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cb69417e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cb69417e

Branch: refs/heads/branch-2.4
Commit: cb69417eb4e21c460c7823fc3580f9393ac61b97
Parents: 8c10a51
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:59:43 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/cb69417e/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/cb69417e/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