类 Tracer
java.lang.Object
com.alibaba.csp.sentinel.Tracer
This class is used to record other exceptions except block exception.
- 作者:
- jialiang.linjl, Eric Zhao
-
字段概要
字段修饰符和类型字段说明 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Get exception predicateGet exception classes to ignore.Get exception classes to trace.static voidsetExceptionPredicate(Predicate<Throwable> exceptionPredicate) set an exception predicate which indicates the exception should be traced(return true) or ignored(return false) except forBlockExceptionstatic voidsetExceptionsToIgnore(Class<? extends Throwable>... ignoreClasses) Set exceptions to ignore.static voidsetExceptionsToTrace(Class<? extends Throwable>... traceClasses) Set exception to trace.protected static booleanCheck whether the throwable should be traced.static voidTrace providedThrowableto the resource entry in current context.static void已过时。static voidtraceContext(Throwable e, int count, Context context) 已过时。static voidtraceContext(Throwable e, Context context) Trace providedThrowableto current entry of given entrance context.static voidtraceEntry(Throwable e, Entry entry) Trace providedThrowableto the given resource entry.
-
字段详细资料
-
traceClasses
-
ignoreClasses
-
exceptionPredicate
-
-
构造器详细资料
-
Tracer
protected Tracer()
-
-
方法详细资料
-
trace
Trace providedThrowableto the resource entry in current context.- 参数:
e- exception to record
-
trace
已过时。Trace providedThrowableto current entry in current context.- 参数:
e- exception to recordcount- exception count to add
-
traceContext
Trace providedThrowableto current entry of given entrance context.- 参数:
e- exception to recordcontext- target entrance context- 从以下版本开始:
- 1.8.0
-
traceContext
已过时。Trace providedThrowableand add exception count to current entry in provided context.- 参数:
e- exception to recordcount- exception count to add- 从以下版本开始:
- 1.4.2
-
traceEntry
Trace providedThrowableto the given resource entry.- 参数:
e- exception to record- 从以下版本开始:
- 1.4.2
-
setExceptionsToTrace
Set exception to trace. If not set, all Exception except forBlockExceptionwill be traced.Note that if both
setExceptionsToIgnore(Class[])and this method is set, the ExceptionsToIgnore will be of higher precedence.- 参数:
traceClasses- the list of exception classes to trace.- 从以下版本开始:
- 1.6.1
-
getExceptionsToTrace
Get exception classes to trace.- 返回:
- an array of exception classes to trace.
- 从以下版本开始:
- 1.6.1
-
setExceptionsToIgnore
Set exceptions to ignore. if not set, all Exception except forBlockExceptionwill be traced.Note that if both
setExceptionsToTrace(Class[])and this method is set, the ExceptionsToIgnore will be of higher precedence.- 参数:
ignoreClasses- the list of exception classes to ignore.- 从以下版本开始:
- 1.6.1
-
getExceptionsToIgnore
Get exception classes to ignore.- 返回:
- an array of exception classes to ignore.
- 从以下版本开始:
- 1.6.1
-
getExceptionPredicate
Get exception predicate- 返回:
- the exception predicate.
-
setExceptionPredicate
set an exception predicate which indicates the exception should be traced(return true) or ignored(return false) except forBlockException- 参数:
exceptionPredicate- the exception predicate
-
shouldTrace
Check whether the throwable should be traced.- 参数:
t- the throwable to check.- 返回:
- true if the throwable should be traced, else return false.
-