|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.web.monitor.ActiveRequestsFilter
public class ActiveRequestsFilter
This filter identifies requests that have taken a long time to process, and logs information about the request. This filter is configurable via servlet filter <init-param> properties, and also at runtime via JMX.
Example filter configuration:<filter> <filter-name>active-requests-filter</filter-name> <filter-class>com.atlassian.jira.web.monitor.ActiveRequestsFilter</filter-class> <!-- register in JMX --> <init-param> <param-name>jmx.name</param-name> <param-value>com.atlassian.jira:name=Requests</param-value> </init-param> <!-- log a INFO entry if a request takes more than this (default: 5s, 0 to disable) --> <init-param> <param-name>request.log.threshold</param-name> <param-value>5000</param-value> </init-param> <!-- create a thread dump if a request takes more than this (default: 30s, 0 to disable) --> <init-param> <param-name>request.dumpthreads.threshold</param-name> <param-value>30000</param-value> </init-param> <!-- save the thread dump in the logs directory --> <init-param> <param-name>request.dumpthreads.dir</param-name> <param-value>${catalina.base}/logs</param-value> </init-param> </filter>This class is thread-safe.
Field Summary | |
---|---|
static String |
JMX_NAME_PARAM
The name of the init-param used to select the JMX name. |
Constructor Summary | |
---|---|
ActiveRequestsFilter()
Creates a new ActiveRequestsFilter. |
Method Summary | |
---|---|
void |
destroy()
Destroys this filter, cancelling the associated timer instance. |
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
Adds a request to the #requestsInProgress map when it begins, and removes it once it has finished. |
void |
init(javax.servlet.FilterConfig filterConfig)
Initialises this filter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String JMX_NAME_PARAM
Constructor Detail |
---|
public ActiveRequestsFilter()
Method Detail |
---|
public void init(javax.servlet.FilterConfig filterConfig)
init
in interface javax.servlet.Filter
filterConfig
- a FilterConfigpublic void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
servletRequest
- a ServletRequestservletResponse
- a ServletResponsefilterChain
- a FilterChain
IOException
- if there is a problem somewhere down the interceptor chain
javax.servlet.ServletException
- if there is a problem somewhere down the interceptor chainpublic void destroy()
destroy
in interface javax.servlet.Filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |