Package org.apache.storm.testing

## Class TrackedTopology

- java.lang.Object
- - org.apache.storm.testing.TrackedTopology

-     public class TrackedTopology
      extends Object

  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

    Constructors
    Constructor | Description
    --- | ---
    `TrackedTopology​(StormTopology origTopo, ILocalCluster cluster)` | Create a new topology to be tracked.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ILocalCluster` | `getCluster()` |
    `StormTopology` | `getTopology()` |
    `int` | `globalAmt​(String key)` | Read a metric from the tracked cluster (NOT JUST THIS TOPOLOGY).
    `void` | `trackedWait()` | 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TrackedTopology

          public TrackedTopology​(StormTopology origTopo,
                                 ILocalCluster cluster)

      Create a new topology to be tracked.
      Parameters:
        `origTopo` - the original topology.
        `cluster` - a cluster that should have been launched with tracking enabled.

  - ### Method Detail

    - #### getTopology

          public StormTopology getTopology()

    - #### getCluster

          public ILocalCluster 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

          public int globalAmt​(String key)

      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