Package com.google.cloud.hadoop.util
Class TraceOperation
- java.lang.Object
-
- com.google.cloud.hadoop.util.TraceOperation
-
- All Implemented Interfaces:
ITraceOperation,AutoCloseable
public class TraceOperation extends Object implements ITraceOperation
Helps trace a block of code.Use
TraceOperation.createRootWithLoggingto setup tracing on a thread. UseTraceOperation.addToExistingTrace to add to the existing tracer. UseTraceOperation.getChildTrace to track operation which runs in another threadNOTE: Ensure that close() is called on each of the operation. NOTE: This class is for internal use and can change without notice.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ITraceOperationaddToExistingTrace(String name)voidannotate(String resultSize, int size)voidclose()static ITraceOperationcreateRootWithLogging(String name, Object context)static ThreadTracecurrent()static ITraceOperationgetChildTrace(ThreadTrace parentTrace, String name)ThreadTracegetTrace()static StringgetTrackingId()
-
-
-
Method Detail
-
createRootWithLogging
public static ITraceOperation createRootWithLogging(String name, Object context)
-
addToExistingTrace
public static ITraceOperation addToExistingTrace(String name)
-
current
public static ThreadTrace current()
-
getChildTrace
public static ITraceOperation getChildTrace(ThreadTrace parentTrace, String name)
-
getTrackingId
public static String getTrackingId()
-
getTrace
public ThreadTrace getTrace()
- Specified by:
getTracein interfaceITraceOperation
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceITraceOperation
-
annotate
public void annotate(String resultSize, int size)
- Specified by:
annotatein interfaceITraceOperation
-
-