Class EndUserFilter

  • All Implemented Interfaces:
    javax.servlet.Filter

    public class EndUserFilter
    extends java.lang.Object
    implements javax.servlet.Filter
    Servlet filter for end user experience monitoring.

    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 Summary

      Constructors 
      Constructor Description
      EndUserFilter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      void doFilter​(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain)
      void init​(javax.servlet.FilterConfig filterConfig)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EndUserFilter

        public EndUserFilter()
    • Method Detail

      • init

        public void init​(javax.servlet.FilterConfig filterConfig)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Filter
        Throws:
        javax.servlet.ServletException
      • doFilter

        public void doFilter​(javax.servlet.ServletRequest servletRequest,
                             javax.servlet.ServletResponse servletResponse,
                             javax.servlet.FilterChain filterChain)
                      throws java.io.IOException,
                             javax.servlet.ServletException
        Specified by:
        doFilter in interface javax.servlet.Filter
        Throws:
        java.io.IOException
        javax.servlet.ServletException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Filter