@Test public void testGetNodeMemoryInfoFunction() { assertEquals(HashMap.class, provider.getNodeMemoryInfo().getClass()); assert(provider.getNodeMemoryInfo() != null); }
public Map<Object, Object> getNodeMemoryInfo() { Map<Object, Object> nodeMemoryInfo = new HashMap<Object, Object>(); Mem mem = null; try { mem = sigar.getMem(); } catch (Exception e) { LOGGER.error(e.getMessage(), e); } nodeMemoryInfo.put("total", mem.getTotal()); nodeMemoryInfo.put("free", mem.getFree()); nodeMemoryInfo.put("used", mem.getUsed()); nodeMemoryInfo.put("actualFree", mem.getActualFree()); nodeMemoryInfo.put("actualUsed", mem.getActualUsed()); nodeMemoryInfo.put("freePercentage", mem.getFreePercent()); nodeMemoryInfo.put("usedPercentage", mem.getUsedPercent()); return nodeMemoryInfo; }
SigarNodeInfoProvider { public Map<Object, Object> getNodeMemoryInfo() { Map<Object, Object> nodeMemoryInfo = new HashMap<Object, Object>(); Mem mem = null; try { mem = sigar.getMem(); } catch (Exception e) { LOGGER.error(e.getMessage(), e); } nodeMemoryInfo.put("total", mem.getTotal()); nodeMemoryInfo.put("free", mem.getFree()); nodeMemoryInfo.put("used", mem.getUsed()); nodeMemoryInfo.put("actualFree", mem.getActualFree()); nodeMemoryInfo.put("actualUsed", mem.getActualUsed()); nodeMemoryInfo.put("freePercentage", mem.getFreePercent()); nodeMemoryInfo.put("usedPercentage", mem.getUsedPercent()); return nodeMemoryInfo; } }
SigarNodeInfoProvider { public Map<Object, Object> getNodeMemoryInfo() { Map<Object, Object> nodeMemoryInfo = new HashMap<Object, Object>(); Mem mem = null; try { mem = sigar.getMem(); } catch (Exception e) { LOGGER.error(e.getMessage(), e); } nodeMemoryInfo.put("total", mem.getTotal()); nodeMemoryInfo.put("free", mem.getFree()); nodeMemoryInfo.put("used", mem.getUsed()); nodeMemoryInfo.put("actualFree", mem.getActualFree()); nodeMemoryInfo.put("actualUsed", mem.getActualUsed()); nodeMemoryInfo.put("freePercentage", mem.getFreePercent()); nodeMemoryInfo.put("usedPercentage", mem.getUsedPercent()); return nodeMemoryInfo; } SigarNodeInfoProvider(); }
SigarNodeInfoProvider { public Map<Object, Object> getNodeMemoryInfo() { Map<Object, Object> nodeMemoryInfo = new HashMap<Object, Object>(); Mem mem = null; try { mem = sigar.getMem(); } catch (Exception e) { LOGGER.error(e.getMessage(), e); } nodeMemoryInfo.put("total", mem.getTotal()); nodeMemoryInfo.put("free", mem.getFree()); nodeMemoryInfo.put("used", mem.getUsed()); nodeMemoryInfo.put("actualFree", mem.getActualFree()); nodeMemoryInfo.put("actualUsed", mem.getActualUsed()); nodeMemoryInfo.put("freePercentage", mem.getFreePercent()); nodeMemoryInfo.put("usedPercentage", mem.getUsedPercent()); return nodeMemoryInfo; } SigarNodeInfoProvider(); Map<Object, Object> getNodeMemoryInfo(); List<Map<Object, Object>> getNodeCpuInfos(); Map<Object, Object> getNodeSwapInfo(); List<Map<Object, Object>> getNodeNetworkInfos(); Map<Object, Object> getNodeOSInfo(); Map<Object, Object> getNodeUpTimeInfo(); List<Map<Object, Object>> getNodeDiskInfos(); List<Map<Object, Object>> getSortedListByItem(final String item); Map<String, Object> getNodeInfo(int topProcessCount); }
SigarNodeInfoProvider { public Map<Object, Object> getNodeMemoryInfo() { Map<Object, Object> nodeMemoryInfo = new HashMap<Object, Object>(); Mem mem = null; try { mem = sigar.getMem(); } catch (Exception e) { LOGGER.error(e.getMessage(), e); } nodeMemoryInfo.put("total", mem.getTotal()); nodeMemoryInfo.put("free", mem.getFree()); nodeMemoryInfo.put("used", mem.getUsed()); nodeMemoryInfo.put("actualFree", mem.getActualFree()); nodeMemoryInfo.put("actualUsed", mem.getActualUsed()); nodeMemoryInfo.put("freePercentage", mem.getFreePercent()); nodeMemoryInfo.put("usedPercentage", mem.getUsedPercent()); return nodeMemoryInfo; } SigarNodeInfoProvider(); Map<Object, Object> getNodeMemoryInfo(); List<Map<Object, Object>> getNodeCpuInfos(); Map<Object, Object> getNodeSwapInfo(); List<Map<Object, Object>> getNodeNetworkInfos(); Map<Object, Object> getNodeOSInfo(); Map<Object, Object> getNodeUpTimeInfo(); List<Map<Object, Object>> getNodeDiskInfos(); List<Map<Object, Object>> getSortedListByItem(final String item); Map<String, Object> getNodeInfo(int topProcessCount); static final char SLEEP; static final char RUN; static final char STOP; static final char ZOMBIE; static final char IDLE; static final int HUNDRED; static final int NUMBER_1024; }