Search in sources :

Example 1 with NodesDataTable

use of models.datatable.NodesDataTable in project coprhd-controller by CoprHD.

the class SystemHealth method systemHealth.

public static void systemHealth() {
    final ViPRSystemClient client = BourneUtil.getSysClient();
    List<NodeHealth> nodeHealthList = MonitorUtils.getNodeHealth(client);
    Map<String, Integer> statusCount = Maps.newHashMap();
    // Initialize Map so with a "Good" status to have 0 services so when we display, if no other service is "Good" it will still display
    // that in UI.
    statusCount.put(Status.GOOD.toString(), 0);
    for (NodeHealth nodeHealth : nodeHealthList) {
        Integer count = statusCount.get(nodeHealth.getStatus());
        statusCount.put(nodeHealth.getStatus(), (count == null) ? 1 : ++count);
    }
    renderArgs.put("allServices", getAllServiceNames(nodeHealthList));
    angularRenderArgs().put("clusterInfo", AdminDashboardUtils.getClusterInfo());
    renderArgs.put("dataTable", new NodesDataTable());
    angularRenderArgs().put("nodeCount", nodeHealthList.size());
    angularRenderArgs().put("statusCount", statusCount);
    render();
}
Also used : ViPRSystemClient(com.emc.vipr.client.ViPRSystemClient) NodesDataTable(models.datatable.NodesDataTable) NodeHealth(com.emc.vipr.model.sys.healthmonitor.NodeHealth)

Aggregations

ViPRSystemClient (com.emc.vipr.client.ViPRSystemClient)1 NodeHealth (com.emc.vipr.model.sys.healthmonitor.NodeHealth)1 NodesDataTable (models.datatable.NodesDataTable)1