Search in sources :

Example 6 with TopologySummary

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;
}
Also used : ClusterSummary(org.apache.storm.generated.ClusterSummary) TopologySummary(org.apache.storm.generated.TopologySummary) TopologyInfo(org.apache.storm.generated.TopologyInfo)

Aggregations

TopologySummary (org.apache.storm.generated.TopologySummary)6 ClusterSummary (org.apache.storm.generated.ClusterSummary)3 ArrayList (java.util.ArrayList)2 SupervisorSummary (org.apache.storm.generated.SupervisorSummary)2 TopologyInfo (org.apache.storm.generated.TopologyInfo)2 DataPoint (org.apache.storm.metric.api.DataPoint)2 HashSet (java.util.HashSet)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 IStormClusterState (org.apache.storm.cluster.IStormClusterState)1 Assignment (org.apache.storm.generated.Assignment)1 ExecutorSummary (org.apache.storm.generated.ExecutorSummary)1 NimbusSummary (org.apache.storm.generated.NimbusSummary)1 SpoutStats (org.apache.storm.generated.SpoutStats)1 StormBase (org.apache.storm.generated.StormBase)1 SupervisorInfo (org.apache.storm.generated.SupervisorInfo)1 NimbusInfo (org.apache.storm.nimbus.NimbusInfo)1 SchedulerAssignment (org.apache.storm.scheduler.SchedulerAssignment)1