org.mortbay.jetty.handler
Class StatisticsHandler

java.lang.Object
  extended by org.mortbay.component.AbstractLifeCycle
      extended by org.mortbay.jetty.handler.AbstractHandler
          extended by org.mortbay.jetty.handler.AbstractHandlerContainer
              extended by org.mortbay.jetty.handler.HandlerWrapper
                  extended by org.mortbay.jetty.handler.AbstractStatisticsHandler
                      extended by org.mortbay.jetty.handler.StatisticsHandler
All Implemented Interfaces:
LifeCycle, Handler, HandlerContainer

public class StatisticsHandler
extends AbstractStatisticsHandler


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle
LifeCycle.Listener
 
Field Summary
 
Fields inherited from class org.mortbay.jetty.handler.AbstractHandler
_string
 
Fields inherited from class org.mortbay.component.AbstractLifeCycle
_listeners
 
Fields inherited from interface org.mortbay.jetty.Handler
ALL, DEFAULT, ERROR, FORWARD, INCLUDE, REQUEST
 
Constructor Summary
StatisticsHandler()
           
 
Method Summary
 int getRequests()
           
 int getRequestsActive()
           
 int getRequestsActiveMax()
           
 long getRequestTimeAverage()
           
 long getRequestTimeMax()
           
 long getRequestTimeMin()
           
 long getRequestTimeTotal()
           
 int getResponses1xx()
           
 int getResponses2xx()
           
 int getResponses3xx()
           
 int getResponses4xx()
           
 int getResponses5xx()
           
 long getStatsOnMs()
           
 void handle(java.lang.String target, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, int dispatch)
          Handle a request.
 void statsReset()
          Resets the current request statistics.
 
Methods inherited from class org.mortbay.jetty.handler.AbstractStatisticsHandler
doStart
 
Methods inherited from class org.mortbay.jetty.handler.HandlerWrapper
addHandler, doStop, expandChildren, getHandler, removeHandler, setHandler, setServer
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandlerContainer
expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandler
destroy, getServer, toString
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mortbay.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

Constructor Detail

StatisticsHandler

public StatisticsHandler()
Method Detail

handle

public void handle(java.lang.String target,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response,
                   int dispatch)
            throws java.io.IOException,
                   javax.servlet.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:
java.io.IOException
javax.servlet.ServletException

statsReset

public void statsReset()
Description copied from class: AbstractStatisticsHandler
Resets the current request statistics.

Specified by:
statsReset in class AbstractStatisticsHandler

getRequests

public int getRequests()
Specified by:
getRequests in class AbstractStatisticsHandler
Returns:
the number of requests handled by this handler since AbstractStatisticsHandler.statsReset() was last called.

getRequestsActive

public int getRequestsActive()
Specified by:
getRequestsActive in class AbstractStatisticsHandler
Returns:
the number of requests currently active. since AbstractStatisticsHandler.statsReset() was last called.

getRequestsActiveMax

public int getRequestsActiveMax()
Specified by:
getRequestsActiveMax in class AbstractStatisticsHandler
Returns:
the maximum number of active requests since AbstractStatisticsHandler.statsReset() was last called.

getResponses1xx

public int getResponses1xx()
Specified by:
getResponses1xx in class AbstractStatisticsHandler
Returns:
the number of responses with a 1xx status returned by this context since AbstractStatisticsHandler.statsReset() was last called.

getResponses2xx

public int getResponses2xx()
Specified by:
getResponses2xx in class AbstractStatisticsHandler
Returns:
the number of responses with a 2xx status returned by this context since AbstractStatisticsHandler.statsReset() was last called.

getResponses3xx

public int getResponses3xx()
Specified by:
getResponses3xx in class AbstractStatisticsHandler
Returns:
the number of responses with a 3xx status returned by this context since AbstractStatisticsHandler.statsReset() was last called.

getResponses4xx

public int getResponses4xx()
Specified by:
getResponses4xx in class AbstractStatisticsHandler
Returns:
the number of responses with a 4xx status returned by this context since AbstractStatisticsHandler.statsReset() was last called.

getResponses5xx

public int getResponses5xx()
Specified by:
getResponses5xx in class AbstractStatisticsHandler
Returns:
the number of responses with a 5xx status returned by this context since AbstractStatisticsHandler.statsReset() was last called.

getStatsOnMs

public long getStatsOnMs()
Specified by:
getStatsOnMs in class AbstractStatisticsHandler
Returns:
the milliseconds since the statistics were started with AbstractStatisticsHandler.statsReset().

getRequestTimeMin

public long getRequestTimeMin()
Specified by:
getRequestTimeMin in class AbstractStatisticsHandler
Returns:
the minimum time (in milliseconds) of request handling since AbstractStatisticsHandler.statsReset() was last called.

getRequestTimeMax

public long getRequestTimeMax()
Specified by:
getRequestTimeMax in class AbstractStatisticsHandler
Returns:
the maximum time (in milliseconds) of request handling since AbstractStatisticsHandler.statsReset() was last called.

getRequestTimeTotal

public long getRequestTimeTotal()
Specified by:
getRequestTimeTotal in class AbstractStatisticsHandler
Returns:
the total time (in milliseconds) of requests handling since AbstractStatisticsHandler.statsReset() was last called.

getRequestTimeAverage

public long getRequestTimeAverage()
Specified by:
getRequestTimeAverage in class AbstractStatisticsHandler
Returns:
the average time (in milliseconds) of request handling since AbstractStatisticsHandler.statsReset() was last called.
See Also:
AbstractStatisticsHandler.getRequestTimeTotal(), AbstractStatisticsHandler.getRequests()


Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.