private void getLinuxEnvironment(Map<String, String> propertyMap) { // the following probably doesn't work on ALL linux Multimap<String, String> cpuInfo = propertiesFromLinuxFile("/proc/cpuinfo"); propertyMap.put("host.cpus", Integer.toString(cpuInfo.get("processor").size())); String s = "cpu cores"; propertyMap.put("host.cpu.cores", describe(cpuInfo, s)); propertyMap.put("host.cpu.names", describe(cpuInfo, "model name")); propertyMap.put("host.cpu.cachesize", describe(cpuInfo, "cache size")); Multimap<String, String> memInfo = propertiesFromLinuxFile("/proc/meminfo"); // TODO redo memInfo.toString() so we don't get square brackets propertyMap.put("host.memory.physical", memInfo.get("MemTotal").toString()); propertyMap.put("host.memory.swap", memInfo.get("SwapTotal").toString()); }
private void getLinuxEnvironment(Map<String, String> propertyMap) { // the following probably doesn't work on ALL linux Multimap<String, String> cpuInfo = propertiesFromLinuxFile("/proc/cpuinfo"); propertyMap.put("host.cpus", Integer.toString(cpuInfo.get("processor").size())); String s = "cpu cores"; propertyMap.put("host.cpu.cores", describe(cpuInfo, s)); propertyMap.put("host.cpu.names", describe(cpuInfo, "model name")); propertyMap.put("host.cpu.cachesize", describe(cpuInfo, "cache size")); Multimap<String, String> memInfo = propertiesFromLinuxFile("/proc/meminfo"); // TODO redo memInfo.toString() so we don't get square brackets propertyMap.put("host.memory.physical", memInfo.get("MemTotal").toString()); propertyMap.put("host.memory.swap", memInfo.get("SwapTotal").toString()); }