org.mortbay.jetty.handler
Class StatisticsHandler
java.lang.Object
org.mortbay.component.AbstractLifeCycle
org.mortbay.jetty.handler.AbstractHandler
org.mortbay.jetty.handler.AbstractHandlerContainer
org.mortbay.jetty.handler.HandlerWrapper
org.mortbay.jetty.handler.StatisticsHandler
- All Implemented Interfaces:
- LifeCycle, Handler, HandlerContainer
public class StatisticsHandler
- extends HandlerWrapper
StatisticsHandler
public StatisticsHandler()
statsReset
public void statsReset()
handle
public void handle(String target,
HttpServletRequest request,
HttpServletResponse response,
int dispatch)
throws IOException,
ServletException
- Description copied from interface:
Handler
- Handle a request.
- Specified by:
handle
in interface Handler
- Overrides:
handle
in class HandlerWrapper
- Parameters:
target
- The target of the request - either a URI or a name.request
- The request either as the Request
object or a wrapper of that request. The HttpConnection.getCurrentConnection()
method can be used access the Request object if required.response
- The response as the Response
object or a wrapper of that request. The HttpConnection.getCurrentConnection()
method can be used access the Response object if required.dispatch
- The dispatch mode: Handler.REQUEST
, Handler.FORWARD
, Handler.INCLUDE
, Handler.ERROR
- Throws:
IOException
ServletException
doStart
protected void doStart()
throws Exception
- Overrides:
doStart
in class HandlerWrapper
- Throws:
Exception
doStop
protected void doStop()
throws Exception
- Overrides:
doStop
in class HandlerWrapper
- Throws:
Exception
getRequests
public int getRequests()
- Returns:
- Get the number of requests handled by this context
since last call of statsReset(). If setStatsOn(false) then this
is undefined.
getRequestsActive
public int getRequestsActive()
- Returns:
- Number of requests currently active.
Undefined if setStatsOn(false).
getRequestsActiveMax
public int getRequestsActiveMax()
- Returns:
- Maximum number of active requests
since statsReset() called. Undefined if setStatsOn(false).
getResponses1xx
public int getResponses1xx()
- Returns:
- Get the number of responses with a 2xx status returned
by this context since last call of statsReset(). Undefined if
if setStatsOn(false).
getResponses2xx
public int getResponses2xx()
- Returns:
- Get the number of responses with a 100 status returned
by this context since last call of statsReset(). Undefined if
if setStatsOn(false).
getResponses3xx
public int getResponses3xx()
- Returns:
- Get the number of responses with a 3xx status returned
by this context since last call of statsReset(). Undefined if
if setStatsOn(false).
getResponses4xx
public int getResponses4xx()
- Returns:
- Get the number of responses with a 4xx status returned
by this context since last call of statsReset(). Undefined if
if setStatsOn(false).
getResponses5xx
public int getResponses5xx()
- Returns:
- Get the number of responses with a 5xx status returned
by this context since last call of statsReset(). Undefined if
if setStatsOn(false).
getStatsOnMs
public long getStatsOnMs()
- Returns:
- Timestamp stats were started at.
getRequestsActiveMin
public int getRequestsActiveMin()
- Returns:
- Returns the requestsActiveMin.
getRequestsDurationMin
public long getRequestsDurationMin()
- Returns:
- Returns the requestsDurationMin.
getRequestsDurationTotal
public long getRequestsDurationTotal()
- Returns:
- Returns the requestsDurationTotal.
getRequestsDurationAve
public long getRequestsDurationAve()
- Returns:
- Average duration of request handling in milliseconds
since statsReset() called. Undefined if setStatsOn(false).
getRequestsDurationMax
public long getRequestsDurationMax()
- Returns:
- Get maximum duration in milliseconds of request handling
since statsReset() called. Undefined if setStatsOn(false).