|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.htrace.Trace
public class Trace
The primary way to interact with the library. Provides methods to start spans, as well as set necessary tracing information.
| Constructor Summary | |
|---|---|
Trace()
|
|
| Method Summary | ||
|---|---|---|
static void |
addKVAnnotation(byte[] key,
byte[] value)
Adds a data annotation to the current span if tracing is currently on. |
|
static void |
addReceiver(SpanReceiver rcvr)
Adds the given SpanReceiver to the current Tracer instance's list of SpanReceivers. |
|
static void |
addTimelineAnnotation(String msg)
Annotate the current span with the given message. |
|
static TraceScope |
continueSpan(Span s)
Pick up an existing span from another thread. |
|
static Span |
currentSpan()
If we are tracing, return the current span, else null |
|
static boolean |
isTracing()
Returns true if the current thread is a part of a trace, false otherwise. |
|
static void |
removeReceiver(SpanReceiver rcvr)
Removes the given SpanReceiver from the list of SpanReceivers. |
|
static void |
setProcessId(String processId)
Set the processId to be used for all Spans created by this Tracer. |
|
static TraceScope |
startSpan(String description)
Starts and returns a new span as the child of the current span if the default sampler (TrueIfTracingSampler) returns true, otherwise returns the NullSpan. |
|
static
|
startSpan(String description,
Sampler<T> s)
|
|
static
|
startSpan(String description,
Sampler<T> s,
T info)
|
|
static TraceScope |
startSpan(String description,
Sampler<TraceInfo> s,
TraceInfo tinfo)
|
|
static TraceScope |
startSpan(String description,
Span parent)
Starts and returns a new span as the child of the parameter 'parent'. |
|
static TraceScope |
startSpan(String description,
TraceInfo tinfo)
|
|
static
|
wrap(Callable<V> callable)
Wrap the callable in a TraceCallable, if tracing. |
|
static Runnable |
wrap(Runnable runnable)
Wrap the runnable in a TraceRunnable, if tracing |
|
static Runnable |
wrap(String description,
Runnable runnable)
Wrap the runnable in a TraceRunnable, if tracing |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Trace()
| Method Detail |
|---|
public static TraceScope startSpan(String description)
description - Description of the span to be created.
public static TraceScope startSpan(String description,
Span parent)
description - Description of the span to be created.parent - The parent that should be used to create the child span that is to
be returned.
public static TraceScope startSpan(String description,
TraceInfo tinfo)
public static <T> TraceScope startSpan(String description,
Sampler<T> s)
public static TraceScope startSpan(String description,
Sampler<TraceInfo> s,
TraceInfo tinfo)
public static <T> TraceScope startSpan(String description,
Sampler<T> s,
T info)
public static TraceScope continueSpan(Span s)
public static void setProcessId(String processId)
processId - Span.javapublic static void removeReceiver(SpanReceiver rcvr)
rcvr - public static void addReceiver(SpanReceiver rcvr)
rcvr -
public static void addKVAnnotation(byte[] key,
byte[] value)
public static void addTimelineAnnotation(String msg)
public static boolean isTracing()
public static Span currentSpan()
public static <V> Callable<V> wrap(Callable<V> callable)
callable -
public static Runnable wrap(Runnable runnable)
runnable -
public static Runnable wrap(String description,
Runnable runnable)
description - name of the span to be created.runnable -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||