use of org.apache.storm.generated.TopologySummary in project storm by apache.
the class MetricsSample method factory.
public static MetricsSample factory(Nimbus.Client client, String topologyName) throws Exception {
// "************ Sampling Metrics *****************
ClusterSummary clusterSummary = client.getClusterInfo();
// get topology info
TopologySummary topSummary = getTopologySummary(clusterSummary, topologyName);
int topologyExecutors = topSummary.get_num_executors();
int topologyWorkers = topSummary.get_num_workers();
int topologyTasks = topSummary.get_num_tasks();
TopologyInfo topInfo = client.getTopologyInfo(topSummary.get_id());
MetricsSample sample = getMetricsSample(topInfo);
sample.numWorkers = topologyWorkers;
sample.numExecutors = topologyExecutors;
sample.numTasks = topologyTasks;
return sample;
}
Aggregations