ca.jimr.gae.profiler
Class MiniProfilerFilter

java.lang.Object
  extended by ca.jimr.gae.profiler.MiniProfilerFilter
All Implemented Interfaces:
Filter

public class MiniProfilerFilter
extends Object
implements Filter

A Servlet filter that enables the MiniProfiler under certain conditions (which are configurable)


Field Summary
protected static String DATA_EXPIRY_KEY
           
protected static String HTML_ID_PREFIX_KEY
           
static String INCLUDES_ATTRIBUTE
           
static String MEMCACHE_KEY_FORMAT_STRING
           
static String MEMCACHE_NAMESPACE
           
protected static String PROFILE_SERVLET_URL_KEY
           
static String REQUEST_ID_ATTRIBUTE
           
static String REQUEST_ID_HEADER
           
static String REQUEST_ID_PARAM_REDIRECT
           
protected static String RESTRICT_TO_ADMINS_KEY
           
protected static String RESTRICT_TO_EMAILS_KEY
           
protected static String RESTRICT_TO_URLS_KEY
           
 
Constructor Summary
MiniProfilerFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(ServletRequest sReq, ServletResponse sRes, FilterChain chain)
          If profiling is supposed to occur for the current request, profile the request.
 void init(FilterConfig config)
           
 boolean shouldProfile(String url)
          Whether the specified URL should be profiled given the current configuration of the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEMCACHE_NAMESPACE

public static final String MEMCACHE_NAMESPACE
See Also:
Constant Field Values

MEMCACHE_KEY_FORMAT_STRING

public static final String MEMCACHE_KEY_FORMAT_STRING
See Also:
Constant Field Values

REQUEST_ID_HEADER

public static final String REQUEST_ID_HEADER
See Also:
Constant Field Values

REQUEST_ID_PARAM_REDIRECT

public static final String REQUEST_ID_PARAM_REDIRECT
See Also:
Constant Field Values

REQUEST_ID_ATTRIBUTE

public static final String REQUEST_ID_ATTRIBUTE
See Also:
Constant Field Values

INCLUDES_ATTRIBUTE

public static final String INCLUDES_ATTRIBUTE
See Also:
Constant Field Values

PROFILE_SERVLET_URL_KEY

protected static final String PROFILE_SERVLET_URL_KEY
See Also:
Constant Field Values

RESTRICT_TO_ADMINS_KEY

protected static final String RESTRICT_TO_ADMINS_KEY
See Also:
Constant Field Values

RESTRICT_TO_EMAILS_KEY

protected static final String RESTRICT_TO_EMAILS_KEY
See Also:
Constant Field Values

RESTRICT_TO_URLS_KEY

protected static final String RESTRICT_TO_URLS_KEY
See Also:
Constant Field Values

DATA_EXPIRY_KEY

protected static final String DATA_EXPIRY_KEY
See Also:
Constant Field Values

HTML_ID_PREFIX_KEY

protected static final String HTML_ID_PREFIX_KEY
See Also:
Constant Field Values
Constructor Detail

MiniProfilerFilter

public MiniProfilerFilter()
Method Detail

init

public void init(FilterConfig config)
          throws ServletException
Specified by:
init in interface Filter
Throws:
ServletException

destroy

public void destroy()
Specified by:
destroy in interface Filter

doFilter

public void doFilter(ServletRequest sReq,
                     ServletResponse sRes,
                     FilterChain chain)
              throws IOException,
                     ServletException
If profiling is supposed to occur for the current request, profile the request. Otherwise this filter does nothing.

Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException

shouldProfile

public boolean shouldProfile(String url)
Whether the specified URL should be profiled given the current configuration of the filter.

Parameters:
url - The URL to check.
Returns:
Whether the URL should be profiled.


Copyright © 2011-2013. All Rights Reserved.