}
public void put(DatedNodeMetricsUpdateDuccEvent duccEvent) {
String location = "put";
MachineSummaryInfo msi = new MachineSummaryInfo();
NodeMetricsUpdateDuccEvent nodeMetrics = duccEvent.getNodeMetricsUpdateDuccEvent();
Ip ip = new Ip(nodeMetrics.getNodeIdentity().getIp().trim());
TreeMap<String, NodeUsersInfo> map = nodeMetrics.getNodeUsersMap();
if(map != null) {
ipToNodeUsersInfoMap.put(ip.toString(), map);
}
String machineName = nodeMetrics.getNodeIdentity().getName().trim();
ipToNameMap.put(ip.toString(),machineName);
nameToIpMap.put(machineName,ip.toString());
double dval = nodeMetrics.getNodeMemory().getMemTotal();
long lval = (long) (dval/(1024*1024)+0.5);
msi.memoryTotal = lval;
msi.sharesTotal = lval/shareSize;
String memTotal = ""+lval/*+memUnits*/;
String sharesTotal = ""+lval/shareSize;
// swap: in-use
double dvalT = nodeMetrics.getNodeMemory().getSwapTotal();
long lvalT = (long) (dvalT/(1024*1024)+0.5);
double dvalF= nodeMetrics.getNodeMemory().getSwapFree();
long lvalF = (long) (dvalF/(1024*1024)+0.5);
lval = lvalT - lvalF;
String memSwap = ""+lval/*+memUnits*/;
msi.memorySwapped = lval;
String swapKey = ip.toString();
String swapVal = ip.toString();
if(msi.memorySwapped > 0) {
isSwapping.put(swapKey, swapVal);
}
else {
isSwapping.remove(swapKey);
}
String sharesInuse = "0";
Properties shareMap = getShareMap(shareSize);
try {
if(shareMap.containsKey(ip.toString())) {
msi.sharesInuse += (Integer)shareMap.get(ip.toString());
sharesInuse = ""+msi.sharesInuse;
}
}
catch(Throwable t) {
logger.warn(location, jobid, t);
}
List<ProcessInfo> alienPids = nodeMetrics.getRogueProcessInfoList();
MachineInfo current = new MachineInfo("", ip.toString(), machineName, memTotal, memSwap, alienPids, sharesTotal, sharesInuse, duccEvent.getMillis(), duccEvent.getEventSize());
String key = normalizeMachineName(machineName);
MachineInfo previous = unsortedMachines.get(key);
if(previous != null) {
long pHbMax = previous.getHeartbeatMax();