public class Trace extends Object
Constructor and Description |
---|
Trace() |
Modifier and Type | Method and Description |
---|---|
static Span |
currentTrace()
Deprecated.
since 1.7 -- it is better to save the span you create in a local variable and call
its methods, rather than retrieving the current span
|
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 void |
offNoFlush()
Deprecated.
since 1.7, use
off() instead |
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()
@Deprecated public static void offNoFlush()
off()
insteadpublic static boolean isTracing()
@Deprecated public static Span currentTrace()
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–2018 The Apache Software Foundation. All rights reserved.