/** * This gathers more information about a host than is available by querying the host list table * directly. * * @param host The host to populate with more information * @param items The data items to enrich the host with * @return The host object with more information attached. */ private Host fullyDescribeHost(Host host, Collection<MetricValue> items) { for (MetricValue item : items) { if (item.getKey().equals(MEMORY_TOTAL_KPI_NAME)) { // Convert to Mb // Original value given in bytes. 1024 * 1024 = 1048576 host.setRamMb((int) (item.getValue() / 1048576)); } if (item.getKey().equals(DISK_TOTAL_KPI_NAME)) { // Convert to Mb // Original value given in bytes. 1024 * 1024 * 1024 = 1073741824 host.setDiskGb((item.getValue() / 1073741824)); } } return host; }