Package org.apache.storm.testing
Class TrackedTopology
java.lang.Object
org.apache.storm.testing.TrackedTopology
A tracked topology keeps metrics for every bolt and spout.
This allows a test to know how many tuples have been fully processed.
Metrics are tracked on a per cluster basis. So only one tracked topology
should be run in a tracked cluster to avoid conflicts.
-
Constructor Summary
ConstructorDescriptionTrackedTopology
(StormTopology origTopo, ILocalCluster cluster) Create a new topology to be tracked. -
Method Summary
Modifier and TypeMethodDescriptionint
Read a metric from the tracked cluster (NOT JUST THIS TOPOLOGY).void
Wait for 1 tuple to be fully processed.void
trackedWait
(int amt) Wait for amt tuples to be fully processed.void
trackedWait
(int amt, int timeoutMs) Wait for amt tuples to be fully processed timeoutMs happens.
-
Constructor Details
-
TrackedTopology
Create a new topology to be tracked.- Parameters:
origTopo
- the original topology.cluster
- a cluster that should have been launched with tracking enabled.
-
-
Method Details
-
getTopology
-
getCluster
-
trackedWait
public void trackedWait()Wait for 1 tuple to be fully processed. -
trackedWait
public void trackedWait(int amt) Wait for amt tuples to be fully processed. -
trackedWait
public void trackedWait(int amt, int timeoutMs) Wait for amt tuples to be fully processed timeoutMs happens. -
globalAmt
Read a metric from the tracked cluster (NOT JUST THIS TOPOLOGY).- Parameters:
key
- one of "spout-emitted", "processed", or "transferred"- Returns:
- the amount of that metric
-