Search in sources :

Example 1 with MemoryStats

use of com.emc.vipr.model.sys.healthmonitor.ProcModels.MemoryStats in project coprhd-controller by CoprHD.

the class SystemHealth method healthDetails.

private static Map<String, Object> healthDetails(NodeStats nodeStats, NodeHealth nodeHealth) {
    MemoryStats memoryStats = nodeStats.getMemoryStats();
    DataDiskStats dataDiskStats = nodeStats.getDataDiskStats();
    Capacity rootCapacity = new Capacity();
    Capacity dataCapacity = new Capacity();
    Capacity memoryCapacity = new Capacity();
    if (memoryStats != null) {
        long freeMem = memoryStats.getMemFree() + memoryStats.getMemBuffers() + memoryStats.getMemCached();
        memoryCapacity = new Capacity((memoryStats.getMemTotal() - freeMem), memoryStats.getMemTotal());
    }
    if (dataDiskStats != null) {
        rootCapacity = new Capacity(dataDiskStats.getRootUsedKB(), dataDiskStats.getRootUsedKB() + dataDiskStats.getRootAvailKB());
        dataCapacity = new Capacity(dataDiskStats.getDataUsedKB(), dataDiskStats.getDataUsedKB() + dataDiskStats.getDataAvailKB());
    }
    List<ServiceHealth> serviceHealthList = nodeHealth.getServiceHealthList();
    Map<String, Integer> statusCount = getStatusCount(serviceHealthList);
    Map<String, Object> nodeDetails = Maps.newHashMap();
    nodeDetails.put("serviceCount", serviceHealthList.size());
    nodeDetails.put("cpuLoad", nodeStats.getLoadAvgStats());
    nodeDetails.put("memoryCapacity", memoryCapacity);
    nodeDetails.put("rootCapacity", rootCapacity);
    nodeDetails.put("dataCapacity", dataCapacity);
    nodeDetails.put("statusCount", statusCount);
    return nodeDetails;
}
Also used : ServiceHealth(com.emc.vipr.model.sys.healthmonitor.ServiceHealth) JsonObject(com.google.gson.JsonObject) DataDiskStats(com.emc.vipr.model.sys.healthmonitor.DataDiskStats) MemoryStats(com.emc.vipr.model.sys.healthmonitor.ProcModels.MemoryStats)

Aggregations

DataDiskStats (com.emc.vipr.model.sys.healthmonitor.DataDiskStats)1 MemoryStats (com.emc.vipr.model.sys.healthmonitor.ProcModels.MemoryStats)1 ServiceHealth (com.emc.vipr.model.sys.healthmonitor.ServiceHealth)1 JsonObject (com.google.gson.JsonObject)1