Class SlowResponseInterceptor
-
- All Implemented Interfaces:
-
org.springframework.core.Ordered,org.springframework.web.servlet.HandlerInterceptor,pro.fessional.wings.slardar.webmvc.AutoRegisterInterceptor
public class SlowResponseInterceptor implements AutoRegisterInterceptor
- Since:
2019-11-16
trydofor
-
-
Field Summary
Fields Modifier and Type Field Description public final static intORDERpublic intorderpublic longthresholdMillispublic BiConsumer<Long, HttpServletRequest>costAndReqConsumerpublic final static intHIGHEST_PRECEDENCEpublic final static intLOWEST_PRECEDENCE
-
Constructor Summary
Constructors Constructor Description SlowResponseInterceptor()
-
Method Summary
Modifier and Type Method Description intgetOrder()voidsetOrder(int order)longgetThresholdMillis()The slow threshold in ms, `-1` means disable voidsetThresholdMillis(long thresholdMillis)The slow threshold in ms, `-1` means disable BiConsumer<Long, HttpServletRequest>getCostAndReqConsumer()Instead of logging, handle time-consuming and SQL yourself voidsetCostAndReqConsumer(BiConsumer<Long, HttpServletRequest> costAndReqConsumer)Instead of logging, handle time-consuming and SQL yourself booleanpreHandle(@NotNull() HttpServletRequest request, @NotNull() HttpServletResponse response, @NotNull() Object handler)voidafterCompletion(@NotNull() HttpServletRequest request, @NotNull() HttpServletResponse response, @NotNull() Object handler, Exception ex)-
Methods inherited from class pro.fessional.wings.slardar.webmvc.AutoRegisterInterceptor
getExcludePatterns, getIncludePatterns -
Methods inherited from class org.springframework.web.servlet.HandlerInterceptor
postHandle -
Methods inherited from class org.springframework.core.Ordered
getOrder -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getOrder
int getOrder()
-
setOrder
void setOrder(int order)
-
getThresholdMillis
long getThresholdMillis()
The slow threshold in ms, `-1` means disable
-
setThresholdMillis
void setThresholdMillis(long thresholdMillis)
The slow threshold in ms, `-1` means disable
-
getCostAndReqConsumer
BiConsumer<Long, HttpServletRequest> getCostAndReqConsumer()
Instead of logging, handle time-consuming and SQL yourself
-
setCostAndReqConsumer
void setCostAndReqConsumer(BiConsumer<Long, HttpServletRequest> costAndReqConsumer)
Instead of logging, handle time-consuming and SQL yourself
-
preHandle
boolean preHandle(@NotNull() HttpServletRequest request, @NotNull() HttpServletResponse response, @NotNull() Object handler)
-
afterCompletion
void afterCompletion(@NotNull() HttpServletRequest request, @NotNull() HttpServletResponse response, @NotNull() Object handler, Exception ex)
-
-
-
-