public class Trace extends Object
Constructor and Description |
---|
Trace() |
Modifier and Type | Method and Description |
---|---|
static long |
currentTraceId()
Get the trace id of the current span.
|
static void |
data(String k,
String v)
Add data to the current span.
|
static boolean |
isTracing()
Returns whether tracing is currently on.
|
static void |
off()
Finish the current trace.
|
static Span |
on(String description)
Start a trace span with a given description.
|
static <T> Span |
on(String description,
org.apache.htrace.Sampler<T> sampler)
Start a trace span with a given description with the given sampler.
|
static Span |
start(String description)
Start a new span with a given name, if already tracing.
|
static Span |
trace(TInfo info,
String description)
Continue a trace by starting a new span with a given parent and description.
|
static Runnable |
wrap(Runnable runnable)
Wrap a runnable in a TraceRunnable, if tracing.
|
static <T> T |
wrapAll(T instance) |
static <T,V> T |
wrapAll(T instance,
org.apache.htrace.Sampler<V> dist) |
public static <T> Span on(String description, org.apache.htrace.Sampler<T> sampler)
public static void off()
public static boolean isTracing()
public static long currentTraceId()
public static Span start(String description)
public static Span trace(TInfo info, String description)
public static <T> T wrapAll(T instance)
public static <T,V> T wrapAll(T instance, org.apache.htrace.Sampler<V> dist)
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.