org.apache.avro.ipc.trace
Class Trace

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

public class Trace
extends Object

A Trace is a tree of spans which reflects the actual call structure of a recursive RPC call tree. Each node in a Trace represents a RPC request/response pair. Each node also has zero or more child nodes.


Constructor Summary
Trace(TraceNode root)
          Construct a trace given a root TraceNode.
 
Method Summary
 int executionPathHash()
          Provide a hashCode unique to the execution path of this trace.
static Trace extractTrace(List<Span> spans)
          Construct a Trace from a list of Span objects.
 TraceNode getRoot()
          Return the root node of this trace.
 String printBrief()
          Print a brief description of this trace describing the execution path, but not timing data.
 String printWithTiming()
          Print a description of this trace which includes timing data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Trace

public Trace(TraceNode root)
Construct a trace given a root TraceNode.

Method Detail

getRoot

public TraceNode getRoot()
Return the root node of this trace.


executionPathHash

public int executionPathHash()
Provide a hashCode unique to the execution path of this trace. This is useful for grouping several traces which represent the same execution path (for instance, when we want to calculate averages for a large number of identical traces).


printBrief

public String printBrief()
Print a brief description of this trace describing the execution path, but not timing data. This is for debugging or quickly profiling traces. For instance the trace: x / w \ y--z is encoded as: (w (x) (y (z)))


printWithTiming

public String printWithTiming()
Print a description of this trace which includes timing data. This is for debugging or quickly profiling traces. For instance the trace: x / w \ x Might print as: w 87ms x 10ms x 2ms


extractTrace

public static Trace extractTrace(List<Span> spans)
Construct a Trace from a list of Span objects. If no such trace can be created (if the list does not describe a complete trace) returns null.



Copyright © 2011 The Apache Software Foundation. All Rights Reserved.