|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.util.profiling.filters.ProfilingFilter
public class ProfilingFilter
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.
| Field Summary | |
|---|---|
protected static java.lang.String |
AUTOSTART_PARAM
This is the parameter you pass to the init parameter & specify in the web.xml file: eg. |
protected StatusUpdateStrategy |
statusUpdateStrategy
|
| Constructor Summary | |
|---|---|
|
ProfilingFilter()
|
protected |
ProfilingFilter(StatusUpdateStrategy statusUpdateStrategy)
|
| Method Summary | |
|---|---|
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
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)
|
protected void |
turnProfilingOff()
|
protected void |
turnProfilingOn()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.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
| Constructor Detail |
|---|
public ProfilingFilter()
protected ProfilingFilter(StatusUpdateStrategy statusUpdateStrategy)
| Method Detail |
|---|
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.Filterjava.io.IOException
javax.servlet.ServletExceptionpublic void init(javax.servlet.FilterConfig filterConfig)
init in interface javax.servlet.Filterpublic void destroy()
destroy in interface javax.servlet.Filterprotected void turnProfilingOn()
protected void turnProfilingOff()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||