Class ProfilingFilter
java.lang.Object
com.atlassian.util.profiling.filters.ProfilingFilter
- All Implemented Interfaces:
javax.servlet.Filter
Deprecated.
Filter that will intercept requests & time how long it takes for them to return. It stores this information
in the ProfilingTimerBean.
Install the filter in your web.xml file as follows:
<filter>
<filter-name>profiling</filter-name>
<filter-class>com.atlassian.util.profiling.filters.ProfilingFilter</filter-class>
<init-param>
<param-name>activate.param</param-name>
<param-value>profilingfilter</param-value>
</init-param>
<init-param>
<param-name>autostart</param-name>
<param-value>false</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>profiling</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
With the above settings you can turn the filter on by accessing any URL with the parameter
profilingfilter=on.eg:
http://mywebsite.com/a.jsp?profilingfilter=on
The above settings also sets the filter to not start automatically upon startup. This may be useful for production, but you will most likely want to set this true in development.
- Author:
- Mike Cannon-Brookes, Scott Farquhar
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringDeprecated.This is the parameter you pass to the init parameter & specify in the web.xml file: eg.protected final StatusUpdateStrategyDeprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionDeprecated.protectedProfilingFilter(StatusUpdateStrategy statusUpdateStrategy) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Deprecated.voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) Deprecated.If the filter is on record start time, pass to filter chain, and then record total time on the return.voidinit(javax.servlet.FilterConfig filterConfig) Deprecated.protected voidDeprecated.protected voidDeprecated.
-
Field Details
-
AUTOSTART_PARAM
Deprecated.This is the parameter you pass to the init parameter & specify in the web.xml file: eg.<filter> <filter-name>profile</filter-name> <filter-class>com.atlassian.util.profiling.filters.ProfilingFilter</filter-class> <init-param> <param-name>autostart</param-name> <param-value>true</param-value> </init-param> </filter>- See Also:
-
statusUpdateStrategy
Deprecated.
-
-
Constructor Details
-
ProfilingFilter
public ProfilingFilter()Deprecated. -
ProfilingFilter
Deprecated.
-
-
Method Details
-
destroy
public void destroy()Deprecated.- Specified by:
destroyin interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException Deprecated.If the filter is on record start time, pass to filter chain, and then record total time on the return. Otherwise just pass to the filter chain. The filter can be activated via a request through the ProfilingStatusUpdateStrategy.- Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
IOExceptionjavax.servlet.ServletException
-
init
public void init(javax.servlet.FilterConfig filterConfig) Deprecated.- Specified by:
initin interfacejavax.servlet.Filter
-
turnProfilingOn
protected void turnProfilingOn()Deprecated. -
turnProfilingOff
protected void turnProfilingOff()Deprecated.
-
RequestProfilingFilterthat allows enabling profiling for individual requests