org.eclipse.jetty.server.handler
Class StatisticsHandler

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

public class StatisticsHandler
extends HandlerWrapper


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
 
Field Summary
 
Fields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
_handler
 
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
Constructor Summary
StatisticsHandler()
           
 
Method Summary
protected  void doStart()
           
 int getRequests()
           
 int getRequestsActive()
           
 int getRequestsActiveMax()
           
 int getRequestsExpired()
           
 int getRequestsResumed()
           
 long getRequestTimeAverage()
           
 long getRequestTimeMax()
           
 long getRequestTimeMin()
           
 long getRequestTimeTotal()
           
 int getResponses1xx()
           
 int getResponses2xx()
           
 int getResponses3xx()
           
 int getResponses4xx()
           
 int getResponses5xx()
           
 long getResponsesBytesTotal()
           
 long getStatsOnMs()
           
 long getSuspendedTimeMin()
           
 long getSuspendedTimeTotal()
           
 void handle(String path, Request request, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
          Handle a request.
 void statsReset()
          Resets the current request statistics.
 
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
doStop, expandChildren, getHandler, getHandlers, setHandler, setServer
 
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
dump, expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
 
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
destroy, dump, getServer, toString
 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, 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.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

Constructor Detail

StatisticsHandler

public StatisticsHandler()
Method Detail

statsReset

public void statsReset()
Resets the current request statistics.


handle

public void handle(String path,
                   Request request,
                   HttpServletRequest httpRequest,
                   HttpServletResponse httpResponse)
            throws IOException,
                   ServletException
Description copied from interface: Handler
Handle a request.

Specified by:
handle in interface Handler
Overrides:
handle in class HandlerWrapper
Parameters:
path - The target of the request - either a URI or a name.
request - The original unwrapped request object.
httpRequest - 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.
httpResponse - 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.
Throws:
IOException
ServletException

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class HandlerWrapper
Throws:
Exception

getRequests

public int getRequests()
Returns:
the number of requests handled by this handler since statsReset() was last called, including resumed requests
See Also:
getRequestsResumed()

getRequestsActive

public int getRequestsActive()
Returns:
the number of requests currently active. since statsReset() was last called.

getRequestsActiveMax

public int getRequestsActiveMax()
Returns:
the maximum number of active requests since statsReset() was last called.

getRequestsResumed

public int getRequestsResumed()
Returns:
the number of requests that have been resumed
See Also:
getRequestsExpired()

getRequestsExpired

public int getRequestsExpired()
Returns:
the number of requests that expired while suspended.
See Also:
getRequestsResumed()

getResponses1xx

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

getResponses2xx

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

getResponses3xx

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

getResponses4xx

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

getResponses5xx

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

getStatsOnMs

public long getStatsOnMs()
Returns:
the milliseconds since the statistics were started with statsReset().

getRequestTimeMin

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

getRequestTimeMax

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

getRequestTimeTotal

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

getRequestTimeAverage

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

getResponsesBytesTotal

public long getResponsesBytesTotal()
Returns:
the total bytes of content sent in responses

getSuspendedTimeMin

public long getSuspendedTimeMin()
Returns:
the minimum time (in milliseconds) of request suspension since statsReset() was last called.

getSuspendedTimeTotal

public long getSuspendedTimeTotal()
Returns:
the total time (in milliseconds) of request suspension since statsReset() was last called.


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