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

    Author:

    trydofor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      int getOrder()
      void setOrder(int order)
      long getThresholdMillis() The slow threshold in ms, `-1` means disable
      void setThresholdMillis(long thresholdMillis) The slow threshold in ms, `-1` means disable
      BiConsumer<Long, HttpServletRequest> getCostAndReqConsumer() Instead of logging, handle time-consuming and SQL yourself
      void setCostAndReqConsumer(BiConsumer<Long, HttpServletRequest> costAndReqConsumer) Instead of logging, handle time-consuming and SQL yourself
      boolean preHandle(@NotNull() HttpServletRequest request, @NotNull() HttpServletResponse response, @NotNull() Object handler)
      void afterCompletion(@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
    • Constructor Detail

      • SlowResponseInterceptor

        SlowResponseInterceptor()
    • Method Detail

      • getThresholdMillis

         long getThresholdMillis()

        The slow threshold in ms, `-1` means disable

      • setThresholdMillis

         void setThresholdMillis(long thresholdMillis)

        The slow threshold in ms, `-1` means disable

      • 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)