----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/36190/#review90482 -----------------------------------------------------------
Ship it! ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py (lines 265 - 271) <https://reviews.apache.org/r/36190/#comment143585> Oh yuck. I'd rather cast the value to a float for math then do this - Nate Cole On July 5, 2015, 11:58 p.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/36190/ > ----------------------------------------------------------- > > (Updated July 5, 2015, 11:58 p.m.) > > > Review request for Ambari, Nate Cole and Tom Beerbower. > > > Bugs: AMBARI-12285 > https://issues.apache.org/jira/browse/AMBARI-12285 > > > Repository: ambari > > > Description > ------- > > Some alerts, such as the HDFS capacity or DataNode capacity always show a > utilization of 0%, preventing any alert from triggering since the state is > always OK. > > This is due to integer division which causes the float percentage to be > rounded down to 0. > > > Diffs > ----- > > ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py fea2f6c > ambari-agent/src/test/python/ambari_agent/TestAlerts.py 4570842 > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java > 47ddd7a > ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json > 4e62eab > > ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json > cee8209 > > Diff: https://reviews.apache.org/r/36190/diff/ > > > Testing > ------- > > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 22.140 s > [INFO] Finished at: 2015-07-05T22:34:46-04:00 > [INFO] Final Memory: 13M/245M > [INFO] > ------------------------------------------------------------------------ > > > Thanks, > > Jonathan Hurley > >
