Package com.peterphi.std.util.tracing
Class Tracing
java.lang.Object
com.peterphi.std.util.tracing.Tracing
-
Field Summary
Modifier and TypeFieldDescriptionstatic boolean
int
boolean
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
static Tracing
get()
static String
static boolean
static String
If verbose tracing is enabled, log an operationstatic String
static void
logOngoing
(String operationId, String name, Object... detail) Log an additional message about an ongoing operationstatic String
Allocate an operation ID within a tracing block, returning null if we are not within a tracing blockstatic Tracing
peek()
static void
static void
static void
static <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()
-