org.apache.avro.ipc.trace
Class TraceCollection

java.lang.Object
  extended by org.apache.avro.ipc.trace.TraceCollection

public class TraceCollection
extends Object

Provides statistics and representation of a collection of Trace's which share the same execution path. For instance: given the following execution pattern: b--d / a \ c--e We might want a report detailing statistics on across several Traces's. Such as a display of average timing data: [message] --- = average link time +++ = average compute time a <----++++++++++++++++++++++++++++++++++++++++---> b <----+++++++++++++++++++---> d <-----++++-----> c <---+++++-> e <+> This requires calculating averages of different timing data at each node in the call tree.


Nested Class Summary
 class TraceCollection.TraceComparotor
           
 class TraceCollection.TraceNodeStats
          Class to store statistics for a particular node in the RPC call tree.
 class TraceCollection.TraceTiming
          Class to store the timing data associated with a particluar trace.
 
Constructor Summary
TraceCollection(Trace t)
          Create a TraceCollection using the given Trace as a model.
 
Method Summary
 void addTrace(Trace t)
          Add a trace to this collection.
 int getExecutionPathHash()
           
 TraceCollection.TraceNodeStats getNodeWithID(int hashCode)
           
 TraceCollection.TraceNodeStats getNodeWithIDRecurse(int hashCode, TraceCollection.TraceNodeStats start)
           
 TraceCollection.TraceNodeStats getRootNode()
           
 TreeSet<Trace> getTraces()
           
 List<Trace> longestTraces(int count)
          Returns the [count] longest traces in this collection.
 String printBrief()
          Print a brief description of this Trace Collection with some summary data.
 String printRecurse(TraceCollection.TraceNodeStats n, int depth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceCollection

public TraceCollection(Trace t)
Create a TraceCollection using the given Trace as a model. Note that we do not add this trace to the statistics tracking in this constructor.

Method Detail

getNodeWithID

public TraceCollection.TraceNodeStats getNodeWithID(int hashCode)

getNodeWithIDRecurse

public TraceCollection.TraceNodeStats getNodeWithIDRecurse(int hashCode,
                                                           TraceCollection.TraceNodeStats start)

getRootNode

public TraceCollection.TraceNodeStats getRootNode()

getExecutionPathHash

public int getExecutionPathHash()

getTraces

public TreeSet<Trace> getTraces()

longestTraces

public List<Trace> longestTraces(int count)
Returns the [count] longest traces in this collection.


addTrace

public void addTrace(Trace t)
Add a trace to this collection. Timing data from this trace will then be included in aggregate statistics.


printBrief

public String printBrief()
Print a brief description of this Trace Collection with some summary data. Useful for debugging or quick profiling.


printRecurse

public String printRecurse(TraceCollection.TraceNodeStats n,
                           int depth)


Copyright © 2010 The Apache Software Foundation