> On Dec. 9, 2014, 6:28 p.m., Srimanth Gunturi wrote: > > Jonathan, I was testing out Ambari-1.7.0, and the output for hosts-summary > > is given in such a way that the sum of all counts is always equal to the > > number of hosts. If a host has CRITICAL and WARNING, it wont contribute to > > WARNING count. Similarly, OKs dont contribute to WARNING. CRITICAL > > > WARNING > UNKNOWN > OK. It is worth verifying how that logic was > > implemented. > > > > For Ambari-2.0.0 we could do it like above. The other option is to > > introduce a new field called CRITICAL_OR_WARNING.
Since we only seem to care about the number of hosts with critical or warning, then I suggest we do: ``` "alerts_summary_hosts" : { "CRITICAL" : 2, "WARNING" : 0, "WARNING_OR_CRITICAL" : 3 } } ``` In fact, we might even just want to do ``` "alerts_summary_hosts" : { "WARNING_OR_CRITICAL" : 3 } } ``` At this point in time since the other calculations could be expensive and they are not used. So, if you're OK with a single value that represents the number of hosts that have either a warning or a critical, then I'd say we go with that. - Jonathan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/28874/#review64462 ----------------------------------------------------------- On Dec. 9, 2014, 5:24 p.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/28874/ > ----------------------------------------------------------- > > (Updated Dec. 9, 2014, 5:24 p.m.) > > > Review request for Ambari, Srimanth Gunturi and Tom Beerbower. > > > Bugs: AMBARI-8623 > https://issues.apache.org/jira/browse/AMBARI-8623 > > > Repository: ambari > > > Description > ------- > > In Ambari-1.7.0 the cluster endpoint used to have a summary of host-counts by > severity. We need such a field in Ambari-2.0.0. > {code} > alerts: { > summary: { > CRITICAL: 1, > OK: 4, > PASSIVE: 0, > WARNING: 0 > } > } > {code} > > The alerts_summary structure currently returned by the 2.0.0 API are the > summary counts of alerts in the system, not those of the hosts. There are > alerts that don't have a host (such as aggregate alerts). > > Add a new field to the cluster endpoint; something like > {{alerts_summary_hosts }} > {noformat} > http://localhost:8080/api/v1/clusters/c1?fields=alerts_summary_hosts > { > "href" : > "http://localhost:8080/api/v1/clusters/c1?fields=alerts_summary_hosts", > "Clusters" : { > "cluster_name" : "c1", > "version" : "HDP-2.2" > }, > "alerts_summary_hosts" : { > "CRITICAL" : 1, > "OK" : 41, > "UNKNOWN" : 0, > "WARNING" : 0 > } > } > {noformat} > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertSummaryPropertyProvider.java > e9fef0e > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java > 4908eea > > ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertsDAOTest.java > 6876877 > > Diff: https://reviews.apache.org/r/28874/diff/ > > > Testing > ------- > > New tests added to cover new summary. > > > Thanks, > > Jonathan Hurley > >