Package com.peterphi.std.util.tracing
Class Tracing
java.lang.Object
com.peterphi.std.util.tracing.Tracing
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanintboolean -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()static Tracingget()static Stringstatic booleanstatic StringIf verbose tracing is enabled, log an operationstatic Stringstatic voidlogOngoing(String operationId, String name, Object... detail) Log an additional message about an ongoing operationstatic StringAllocate an operation ID within a tracing block, returning null if we are not within a tracing blockstatic Tracingpeek()static voidstatic voidstatic voidstatic <T,R> Function<T, R> Wrap a function call in a trace block; designed for use in a parallel streamstatic <T,R> Function<T, R> Wrap a function call in a trace block; designed for use in a parallel stream
-
Field Details
-
DEFAULT_VERBOSE
public static boolean DEFAULT_VERBOSE -
id
-
ops
public int ops -
verbose
public boolean verbose
-
-
Method Details
-
peek
-
get
-
stop
-
clear
public static void clear() -
start
-
start
-
newOperationId
Allocate an operation ID within a tracing block, returning null if we are not within a tracing block- Returns:
-
wrap
Wrap a function call in a trace block; designed for use in a parallel stream- Type Parameters:
T- the type of the input to the functionR- the type of the result of the function- Returns:
-
wrap
Wrap a function call in a trace block; designed for use in a parallel stream- Type Parameters:
T- the type of the input to the functionR- the type of the result of the function- Returns:
-
log
-
log
If verbose tracing is enabled, log an operation- Parameters:
detail- an array of items; will be reduced to String and concatenated together; if a Supplier is in the list, it will be invoked- Returns:
- an operation identifier (if we're within a tracing block)
-
logOngoing
Log an additional message about an ongoing operation- Parameters:
operationId- the operation id returned by eitherlog(String, Supplier)ornewOperationId()name-detail-
-
getTraceId
-
isVerbose
public static boolean isVerbose()
-