StringBuffer row;
StringBuffer data = new StringBuffer();
DuccMachinesData instance = DuccMachinesData.getInstance();
MachineFactsList factsList = instance.getMachineFactsList();
if(factsList.size() > 0) {
// Total
listIterator = factsList.listIterator();
while(listIterator.hasNext()) {
MachineFacts facts = listIterator.next();
try {
sumReserve += Integer.parseInt(facts.reserve);
sumMemory += Integer.parseInt(facts.memory);
sumSwap += Integer.parseInt(facts.swap);
sumAliens += facts.aliens.size();
sumSharesTotal += Integer.parseInt(facts.sharesTotal);
sumSharesInuse += Integer.parseInt(facts.sharesInuse);
}
catch(Exception e) {
duccLogger.error(methodName, jobid, e);
}
}
row = new StringBuffer();
row.append("<tr>");
// Release ALL Stuck JPs
row.append("<td>");
String releaseAll = buildReleaseAll(request, factsList);
row.append(releaseAll);
row.append("</td>");
// Status
row.append("<td>");
row.append(""+"Total");
row.append("</td>");
// IP
row.append("<td>");
row.append("");
row.append("</td>");
// Name
row.append("<td>");
row.append("");
row.append("</td>");
// Reserve: total
row.append("<td align=\"right\">");
row.append(""+sumReserve);
row.append("</td>");
// Memory: total
row.append("<td align=\"right\">");
row.append(""+sumMemory);
row.append("</td>");
// Swap: inuse
row.append("<td align=\"right\">");
row.append(""+sumSwap);
row.append("</td>");
// Alien PIDs
row.append("<td align=\"right\">");
row.append(""+sumAliens);
row.append("</td>");
// Shares: total
row.append("<td align=\"right\">");
row.append(""+sumSharesTotal);
row.append("</td>");
// Shares:inuse
row.append("<td align=\"right\">");
row.append(""+sumSharesInuse);
row.append("</td>");
// Heartbeat: last
row.append("<td align=\"right\">");
row.append("");
row.append("</td>");
row.append("</tr>");
data.append(row);
// Individual Machines
listIterator = factsList.listIterator();
while(listIterator.hasNext()) {
MachineFacts facts = listIterator.next();
row = new StringBuffer();
row.append((trGet(counter)));
// Release Machine Stuck JPs