RequestProfilingFilter that allows enabling
profiling for individual requests@Deprecated public class ProfilingFilter extends Object implements javax.servlet.Filter
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.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
AUTOSTART_PARAM
Deprecated.
This is the parameter you pass to the init parameter & specify in the web.xml file: eg.
|
protected StatusUpdateStrategy |
statusUpdateStrategy
Deprecated.
|
| Modifier | Constructor and Description |
|---|---|
|
ProfilingFilter()
Deprecated.
|
protected |
ProfilingFilter(StatusUpdateStrategy statusUpdateStrategy)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Deprecated.
|
void |
doFilter(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.
|
void |
init(javax.servlet.FilterConfig filterConfig)
Deprecated.
|
protected void |
turnProfilingOff()
Deprecated.
|
protected void |
turnProfilingOn()
Deprecated.
|
protected static final String AUTOSTART_PARAM
<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>
protected final StatusUpdateStrategy statusUpdateStrategy
public ProfilingFilter()
protected ProfilingFilter(StatusUpdateStrategy statusUpdateStrategy)
public void destroy()
destroy in interface javax.servlet.Filterpublic void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.FilterIOExceptionjavax.servlet.ServletExceptionpublic void init(javax.servlet.FilterConfig filterConfig)
init in interface javax.servlet.Filterprotected void turnProfilingOn()
protected void turnProfilingOff()
Copyright © 2019 Atlassian. All rights reserved.