}
}
// if we are in local mode, we cannot obtain these information
public static void writeStormStats(Map conf) {
final Client client = getNimbusStub(conf);
final StringBuilder sb = new StringBuilder("");
try {
final ClusterSummary clusterInfo = client.getClusterInfo();
final int numOfTopologies = clusterInfo.get_topologies_size();
sb.append("In total there is ").append(numOfTopologies).append(" topologies.\n");
final Iterator<TopologySummary> topologyIter = clusterInfo.get_topologies_iterator();
while (topologyIter.hasNext()) {
final TopologySummary topologySummary = topologyIter.next();
// print out basic information about topologies
final String topologyName = topologySummary.get_name();
sb.append("For topology ").append(topologyName).append(":\n");
final int numTasks = topologySummary.get_num_tasks();
sb.append(numTasks).append(" tasks, ");
final int numWorkers = topologySummary.get_num_workers();
sb.append(numWorkers).append(" workers, ");
final int uptimeSecs = topologySummary.get_uptime_secs();
sb.append(uptimeSecs).append(" uptime seconds.\n");
final String topologyID = topologySummary.get_id();
final String topologyConf = client.getTopologyConf(topologyID);
sb.append("Topology configuration is \n");
sb.append(topologyConf);
sb.append("\n");
final TopologyInfo topologyInfo = client.getTopologyInfo(topologyID);
// print more about each task
final Iterator<ExecutorSummary> execIter = topologyInfo.get_executors_iterator();
boolean globalFailed = false;
while (execIter.hasNext()) {