-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/#review186980
-----------------------------------------------------------


Fix it, then Ship it!





ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
Lines 20-21 (patched)
<https://reviews.apache.org/r/62744/#comment263931>

    This is a funny looking import.  Use java.util.Collections directly.



ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
Lines 53-55 (patched)
<https://reviews.apache.org/r/62744/#comment263932>

    nit: formatting; @Inject usually goes on its own line



ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java
Lines 24-25 (patched)
<https://reviews.apache.org/r/62744/#comment263933>

    javadoc would be helpful



ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
Lines 227-231 (patched)
<https://reviews.apache.org/r/62744/#comment263935>

    nit: formatting is a bit off


- Nate Cole


On Oct. 3, 2017, 7:01 a.m., Attila Magyar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62744/
> -----------------------------------------------------------
> 
> (Updated Oct. 3, 2017, 7:01 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-22115
>     https://issues.apache.org/jira/browse/AMBARI-22115
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> This is part of AMBARI-22115. We need to define alerts on JMX metrics which 
> are pulled from a cluster that is not necessarily managed by Ambari. 
> Therefore alerts can't run on ambari-agent host. I introduced a new SERVER 
> type alert called JmxServerSideAlert that can pull the jmx metrics from a 
> arbitrary url. The url comes from the alerts.json and it may contain 
> placeholders like ${hdfs-site/dfs.namenode.http-address}. This works 
> similarly than the Python class MetricAlert.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
>  PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
> PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
>  81d72fb 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 
> 5d2ecc6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
>  93801d5 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
>  4aeba45 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
>  c58867a 
>   
> ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62744/diff/1/
> 
> 
> Testing
> -------
> 
> Used the following alerts.json to test it
> 
> {   
>   "ONEFS":{
>     "service": [
>       { 
>         "name": "onefs_namenode_cpu",
>         "label": "OneFS NameNode Host CPU Utilization",
>         "description": "This host-level alert is triggered if CPU utilization 
> of the NameNode exceeds certain warning and critical thresholds. It checks 
> the NameNode JMX Servlet for the SystemCPULoad property. The threshold values 
> are in percent.",
>         "interval": 1,
>         "help_url": 
> "https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat";,
>         "scope": "HOST",
>         "enabled": true,
>         "source": {
>           "type": "SERVER",
>           "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
>           "uri": {
>             "http": "${hdfs-site/dfs.namenode.http-address}",
>             "https": "${hdfs-site/dfs.namenode.https-address}",
>             "https_property": "${hdfs-site/dfs.http.policy}",
>             "https_property_value": "HTTPS_ONLY",
>             "connection_timeout": 5.0
>           },
>           "reporting": {
>             "ok": {
>               "text": "{1} CPU, load {0,number,percent}"
>             },
>             "warning": {
>               "text": "{1} CPU, load {0,number,percent}",
>               "value": 5
>             },
>             "critical": {
>               "text": "{1} CPU, load {0,number,percent}",
>               "value": 20
>             },
>             "units" : "%",
>             "type": "PERCENT"
>            },
>            "jmx": {
>              "property_list": [
>               "java.lang:type=OperatingSystem/SystemCpuLoad",
>               "java.lang:type=OperatingSystem/AvailableProcessors"
>              ]
>            }
>           }
>       }
>     ]
>   }
> }
>                                         1,1           Top
> 
> 
> Thanks,
> 
> Attila Magyar
> 
>

Reply via email to