> On Jan. 26, 2016, 1:55 a.m., Alejandro Fernandez wrote: > > ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/alerts/alert_metrics_deviation.py, > > line 300 > > <https://reviews.apache.org/r/42706/diff/1/?file=1219149#file1219149line300> > > > > Only valid if length of list > 1. > > Dmytro Sen wrote: > the list never has < 2 elements, I do > if not metrics or len(metrics) < 2: > return (RESULT_STATE_UNKNOWN, ["Unable to calculate the standard > deviation for {0} datapoints".format(len(metrics))])
My suggestion is to place this type of logic into the function itself instead of the caller to avoid having to duplicate it should it ever be called by multiple places. - Alejandro ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/42706/#review116252 ----------------------------------------------------------- On Jan. 26, 2016, 4:03 p.m., Dmytro Sen wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/42706/ > ----------------------------------------------------------- > > (Updated Jan. 26, 2016, 4:03 p.m.) > > > Review request for Ambari, Jonathan Hurley and Sid Wagle. > > > Bugs: AMBARI-14800 > https://issues.apache.org/jira/browse/AMBARI-14800 > > > Repository: ambari > > > Description > ------- > > Implement script alert based on AMS metrics standard deviation > > > Diffs > ----- > > ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json > 1eda00f > > ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py > PRE-CREATION > > Diff: https://reviews.apache.org/r/42706/diff/ > > > Testing > ------- > > Unit tests passed > > > Thanks, > > Dmytro Sen > >
