public class EndUserFilter
extends java.lang.Object
implements javax.servlet.Filter
To enable end user experience monitoring, you have to add this servlet filter to your web.xml file. The servlet filter checks if the response consists of HTML, has a valid <head> tag and is being generated as part of a business transaction. In that case it injects a script that will report back monitoring data from the browser after the page has been loaded. The script will make a request to a URL starting with /__perfino/ below the context path. You have to make sure that requests matching /__perfino/* are passed to this filter.
Special care has to be taken to insert the filter at a stage where the response has not been compressed yet. For example, if you have a filter that gzips the response, the EndUserFilter has to be added after it, so it can access and modify the uncompressed HTML.
It is not recommended to use end-user experience monitoring for cached pages. If cached pages are served through this filter, the sampling percentage for end user experience monitoring that is defined in the perfino UI should be either 0% or 100%.
To add the filter to your web.xml file, add the filter definition:
<filter>
<filter-name>euem</filter-name>
<filter-class>com.perfino.filter.EndUserFilter</filter-class>
</filter>
Then add appropriate filter mappings for the URLs that you would like to monitor. To monitor HTML pages in all URLs, add:
<filter-mapping>
<filter-name>euem</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
If you only monitor selected URLs, add the following additional filter mapping as the first mapping:
<filter-mapping>
<filter-name>euem</filter-name>
<url-pattern>/__perfino/*</url-pattern>
</filter-mapping>
Constructor and Description |
---|
EndUserFilter() |
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
public void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws java.io.IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
java.io.IOException
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Filter