String nimbustime = StatBuckets.prettyUptimeStr(summ
.get_nimbus_uptime_secs());
List<ClusterSumm> clusumms = new ArrayList<ClusterSumm>();
ClusterSumm clusterSumm = new ClusterSumm();
String master = client.getMasterHost();
clusterSumm.setNimbusHostname(master);
if (master.contains(":")) {
clusterSumm.setNimbusIp(NetWorkUtils.host2Ip(master.substring(0,
master.indexOf(":"))));
} else {
clusterSumm.setNimbusIp(NetWorkUtils.host2Ip(master));
}
int port = ConfigExtension.getNimbusDeamonHttpserverPort(conf);
clusterSumm.setNimbusLogPort(String.valueOf(port));
clusterSumm.setNimbusUptime(nimbustime);
clusterSumm.setSupervisorNum(String.valueOf(supSize));
clusterSumm.setRunningTaskNum(String.valueOf(totalTasks));
clusterSumm.setTotalPortSlotNum(String.valueOf(totalPortSlots));
clusterSumm.setUsedPortSlotNum(String.valueOf(usePortSlots));
clusterSumm.setFreePortSlotNum(String.valueOf(freePortSlots));
clusterSumm.setVersion(summ.get_version());
clusumms.add(clusterSumm);
return clusumms;
}