类 WebMvcMetricsFilter
- java.lang.Object
- org.springframework.web.filter.GenericFilterBean
- org.springframework.web.filter.OncePerRequestFilter
- org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter
- 所有已实现的接口:
javax.servlet.Filter
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.EnvironmentAware
,org.springframework.core.env.EnvironmentCapable
,org.springframework.web.context.ServletContextAware
public class WebMvcMetricsFilter extends org.springframework.web.filter.OncePerRequestFilter
Intercepts incoming HTTP requests and records metrics about Spring MVC execution time and results.- 从以下版本开始:
- 2.0.0
构造器概要
构造器 构造器 说明 WebMvcMetricsFilter(io.micrometer.core.instrument.MeterRegistry registry, WebMvcTagsProvider tagsProvider, String metricName, boolean autoTimeRequests)
Create a newWebMvcMetricsFilter
instance.WebMvcMetricsFilter(org.springframework.context.ApplicationContext context, io.micrometer.core.instrument.MeterRegistry registry, WebMvcTagsProvider tagsProvider, String metricName, boolean autoTimeRequests)
已过时。since 2.0.7 in favor ofWebMvcMetricsFilter(MeterRegistry, WebMvcTagsProvider, String, boolean)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)
protected boolean
shouldNotFilterAsyncDispatch()
从类继承的方法 org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterErrorDispatch
构造器详细资料
WebMvcMetricsFilter
@Deprecated public WebMvcMetricsFilter(org.springframework.context.ApplicationContext context, io.micrometer.core.instrument.MeterRegistry registry, WebMvcTagsProvider tagsProvider, String metricName, boolean autoTimeRequests)
已过时。since 2.0.7 in favor ofWebMvcMetricsFilter(MeterRegistry, WebMvcTagsProvider, String, boolean)
Create a newWebMvcMetricsFilter
instance.- 参数:
context
- the source application contextregistry
- the meter registrytagsProvider
- the tags providermetricName
- the metric nameautoTimeRequests
- if requests should be automatically timed
WebMvcMetricsFilter
public WebMvcMetricsFilter(io.micrometer.core.instrument.MeterRegistry registry, WebMvcTagsProvider tagsProvider, String metricName, boolean autoTimeRequests)
Create a newWebMvcMetricsFilter
instance.- 参数:
registry
- the meter registrytagsProvider
- the tags providermetricName
- the metric nameautoTimeRequests
- if requests should be automatically timed- 从以下版本开始:
- 2.0.7
方法详细资料
shouldNotFilterAsyncDispatch
protected boolean shouldNotFilterAsyncDispatch()
- 覆盖:
shouldNotFilterAsyncDispatch
在类中org.springframework.web.filter.OncePerRequestFilter
doFilterInternal
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, IOException
- 指定者:
doFilterInternal
在类中org.springframework.web.filter.OncePerRequestFilter
- 抛出:
javax.servlet.ServletException
IOException