org.eclipse.jetty.server.handler
Class StatisticsHandler

java.lang.Object
  extended by org.eclipse.jetty.util.component.AbstractLifeCycle
      extended by org.eclipse.jetty.util.component.AggregateLifeCycle
          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, Destroyable, Dumpable, LifeCycle

public class StatisticsHandler
extends HandlerWrapper


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
 
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 getDispatched()
           
 int getDispatchedActive()
           
 int getDispatchedActiveMax()
           
 long getDispatchedTimeMax()
           
 double getDispatchedTimeMean()
           
 double getDispatchedTimeStdDev()
           
 long getDispatchedTimeTotal()
           
 int getExpires()
           
 int getRequests()
           
 int getRequestsActive()
           
 int getRequestsActiveMax()
           
 long getRequestTimeMax()
           
 double getRequestTimeMean()
           
 double getRequestTimeStdDev()
           
 long getRequestTimeTotal()
           
 int getResponses1xx()
           
 int getResponses2xx()
           
 int getResponses3xx()
           
 int getResponses4xx()
           
 int getResponses5xx()
           
 long getResponsesBytesTotal()
           
 int getResumes()
           
 long getStatsOnMs()
           
 int getSuspends()
           
 int getSuspendsActive()
           
 int getSuspendsActiveMax()
           
 void handle(String path, Request request, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
          Handle a request.
 void statsReset()
          Resets the current request statistics.
 String toStatsHTML()
           
 
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
destroy, doStop, expandChildren, getHandler, getHandlers, getNestedHandlerByClass, 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
dumpThis, getServer
 
Methods inherited from class org.eclipse.jetty.util.component.AggregateLifeCycle
addBean, dump, dump, dump, dump, dumpStdErr, getBean, getBeans, getBeans, removeBean, removeBeans
 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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, excluding active requests
See Also:
getResumes()

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.

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.

getRequestTimeMean

public double getRequestTimeMean()
Returns:
the mean time (in milliseconds) of request handling since statsReset() was last called.
See Also:
getRequestTimeTotal(), getRequests()

getRequestTimeStdDev

public double getRequestTimeStdDev()
Returns:
the standard deviation of time (in milliseconds) of request handling since statsReset() was last called.
See Also:
getRequestTimeTotal(), getRequests()

getDispatched

public int getDispatched()
Returns:
the number of dispatches seen by this handler since statsReset() was last called, excluding active dispatches

getDispatchedActive

public int getDispatchedActive()
Returns:
the number of dispatches currently in this handler since statsReset() was last called, including resumed requests

getDispatchedActiveMax

public int getDispatchedActiveMax()
Returns:
the max number of dispatches currently in this handler since statsReset() was last called, including resumed requests

getDispatchedTimeMax

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

getDispatchedTimeTotal

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

getDispatchedTimeMean

public double getDispatchedTimeMean()
Returns:
the mean time (in milliseconds) of request handling since statsReset() was last called.
See Also:
getRequestTimeTotal(), getRequests()

getDispatchedTimeStdDev

public double getDispatchedTimeStdDev()
Returns:
the standard deviation of time (in milliseconds) of request handling since statsReset() was last called.
See Also:
getRequestTimeTotal(), getRequests()

getSuspends

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

getSuspendsActive

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

getSuspendsActiveMax

public int getSuspendsActiveMax()
Returns:
the maximum number of current suspended requests since statsReset() was last called.

getResumes

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

getExpires

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

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().

getResponsesBytesTotal

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

toStatsHTML

public String toStatsHTML()


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