You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by av...@apache.org on 2016/03/28 22:16:29 UTC

ambari git commit: AMBARI-15607 : HDFS Alerts for AMS Throw Unsupported operand type error (avijayan)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 30b7fac65 -> 55fe5c494


AMBARI-15607 : HDFS Alerts for AMS Throw Unsupported operand type error (avijayan)


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

Branch: refs/heads/branch-2.2
Commit: 55fe5c494ac50f28639eebd61b1dd94e022915f7
Parents: 30b7fac
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Mon Mar 28 13:16:16 2016 -0700
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Mon Mar 28 13:16:24 2016 -0700

----------------------------------------------------------------------
 .../2.1.0.2.0/package/alerts/alert_metrics_deviation.py   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/55fe5c49/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
index 741c201..9a122fa 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
@@ -312,11 +312,11 @@ def execute(configurations={}, parameters={}, host_name=None):
   if not metrics or len(metrics) < 2:
     return (RESULT_STATE_UNKNOWN, ["Unable to calculate the standard deviation for {0} datapoints".format(len(metrics))])
 
-  # Filter out points below min threshold
-  metrics = [metric for metric in metrics if metric > (minimum_value_threshold * 1000)]
-
-  if len(metrics) < 2:
-    return (RESULT_STATE_OK, ['No datapoints found above the minimum threshold of {0} seconds'.format(minimum_value_threshold)])
+  if minimum_value_threshold:
+    # Filter out points below min threshold
+    metrics = [metric for metric in metrics if metric > (minimum_value_threshold * 1000)]
+    if len(metrics) < 2:
+      return (RESULT_STATE_OK, ['No datapoints found above the minimum threshold of {0} seconds'.format(minimum_value_threshold)])
 
   mean = calculate_mean(metrics)
   stddev = calulate_sample_std_deviation(metrics)