Class LongTaskTimingHandlerInterceptor
java.lang.Object
org.springframework.boot.actuate.metrics.web.servlet.LongTaskTimingHandlerInterceptor
- All Implemented Interfaces:
HandlerInterceptor
A
HandlerInterceptor
that supports Micrometer's long task timers configured on
a handler using @Timed
with longTask
set to
true
.- Since:
- 2.0.7
- Author:
- Andy Wilkinson
-
Constructor Summary
ConstructorDescriptionLongTaskTimingHandlerInterceptor
(io.micrometer.core.instrument.MeterRegistry registry, WebMvcTagsProvider tagsProvider) Creates a newLongTaskTimingHandlerInterceptor
that will createLongTaskTimers
using the given registry. -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterCompletion
(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) boolean
preHandle
(HttpServletRequest request, HttpServletResponse response, Object handler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.servlet.HandlerInterceptor
postHandle
-
Constructor Details
-
LongTaskTimingHandlerInterceptor
public LongTaskTimingHandlerInterceptor(io.micrometer.core.instrument.MeterRegistry registry, WebMvcTagsProvider tagsProvider) Creates a newLongTaskTimingHandlerInterceptor
that will createLongTaskTimers
using the given registry. Timers will be tagged using the giventagsProvider
.- Parameters:
registry
- the registrytagsProvider
- the tags provider
-
-
Method Details
-
preHandle
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception - Specified by:
preHandle
in interfaceHandlerInterceptor
- Throws:
Exception
-
afterCompletion
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception - Specified by:
afterCompletion
in interfaceHandlerInterceptor
- Throws:
Exception
-