Top Fields Constructors Methods
org.mortbay.jetty.handler

public Class StatisticsHandler

extends HandlerWrapper
implements CompleteHandler
Class Inheritance
All Implemented Interfaces
org.mortbay.jetty.handler.CompleteHandler
Imports
java.io.IOException, javax.servlet.ServletException, javax.servlet.http.HttpServletRequest, .HttpServletResponse, org.mortbay.jetty.HttpConnection, .Request, .Response, org.mortbay.util.LazyList

Field Summary

Modifier and TypeField and Description
pack-priv transient int
pack-priv transient int
pack-priv transient long
pack-priv transient long
pack-priv transient long
pack-priv transient int
pack-priv transient int
pack-priv transient long
pack-priv transient long
pack-priv transient long
pack-priv transient int
pack-priv transient int
pack-priv transient int
pack-priv transient int
pack-priv transient int
pack-priv transient int
pack-priv transient int
pack-priv transient long
pack-priv transient long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addRequestsDurationTotal(long duration)

public void
complete(Request
the request which has just completed
request
)

Implements org.mortbay.jetty.handler.CompleteHandler.complete.

Handle completed requests.
protected void
protected void
public int

Returns:

Get the number of requests handled by this context since last call of statsReset(), not counting resumed requests. If setStatsOn(false) then this is undefined.
getRequests
()

public int

Returns:

Number of requests currently active. Undefined if setStatsOn(false).
getRequestsActive
()

public long

Returns:

Average duration of request handling in milliseconds since statsReset() called. Undefined if setStatsOn(false).
getRequestsActiveDurationAve
()

public long

Returns:

Get maximum duration in milliseconds of request handling since statsReset() called. Undefined if setStatsOn(false).
getRequestsActiveDurationMax
()

public long

Returns:

Returns the requestsActiveDurationMin.
getRequestsActiveDurationMin
()

public long

Returns:

Returns the requestsActiveDurationTotal.
getRequestsActiveDurationTotal
()

public int

Returns:

Maximum number of active requests since statsReset() called. Undefined if setStatsOn(false).
getRequestsActiveMax
()

public int

Returns:

Returns the requestsActiveMin.
getRequestsActiveMin
()

public long

Returns:

Average duration of request handling in milliseconds since statsReset() called. Undefined if setStatsOn(false).
getRequestsDurationAve
()

public long

Returns:

Get maximum duration in milliseconds of request handling since statsReset() called. Undefined if setStatsOn(false).
getRequestsDurationMax
()

public long

Returns:

Returns the requestsDurationMin.
getRequestsDurationMin
()

public long

Returns:

Returns the requestsDurationTotal.
getRequestsDurationTotal
()

public int

Returns:

Number of requests that have been resumed. Undefined if setStatsOn(false).
getRequestsResumed
()

public int

Returns:

Number of requests that timed out while suspended. Undefined if setStatsOn(false).
getRequestsTimedout
()

public int

Returns:

Get the number of responses with a 2xx status returned by this context since last call of statsReset(). Undefined if if setStatsOn(false).
getResponses1xx
()

public int

Returns:

Get the number of responses with a 100 status returned by this context since last call of statsReset(). Undefined if if setStatsOn(false).
getResponses2xx
()

public int

Returns:

Get the number of responses with a 3xx status returned by this context since last call of statsReset(). Undefined if if setStatsOn(false).
getResponses3xx
()

public int

Returns:

Get the number of responses with a 4xx status returned by this context since last call of statsReset(). Undefined if if setStatsOn(false).
getResponses4xx
()

public int

Returns:

Get the number of responses with a 5xx status returned by this context since last call of statsReset(). Undefined if if setStatsOn(false).
getResponses5xx
()

public long

Returns:

Total bytes of content sent in responses
getResponsesBytesTotal
()

public long

Returns:

Timestamp stats were started at.
getStatsOnMs
()

public void
handle(String
The target of the request - either a URI or a name.
target
,
HttpServletRequest
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.
request
,
HttpServletResponse
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.
response
,
int
The dispatch mode: REQUEST, FORWARD, INCLUDE, ERROR
dispatch
)

Overrides org.mortbay.jetty.handler.HandlerWrapper.handle.

Implements org.mortbay.jetty.Handler.handle.

Handle a request.
public void
Inherited from org.mortbay.jetty.handler.HandlerWrapper:
addHandlerexpandChildrengetHandlerremoveHandlersetHandlersetServer

Field Detail

_requestsback to summary
pack-priv transient int _requests
_requestsActiveback to summary
pack-priv transient int _requestsActive
_requestsActiveDurationMaxback to summary
pack-priv transient long _requestsActiveDurationMax
_requestsActiveDurationMinback to summary
pack-priv transient long _requestsActiveDurationMin
_requestsActiveDurationTotalback to summary
pack-priv transient long _requestsActiveDurationTotal
_requestsActiveMaxback to summary
pack-priv transient int _requestsActiveMax
_requestsActiveMinback to summary
pack-priv transient int _requestsActiveMin
_requestsDurationMaxback to summary
pack-priv transient long _requestsDurationMax
_requestsDurationMinback to summary
pack-priv transient long _requestsDurationMin
_requestsDurationTotalback to summary
pack-priv transient long _requestsDurationTotal
_requestsResumedback to summary
pack-priv transient int _requestsResumed
_requestsTimedoutback to summary
pack-priv transient int _requestsTimedout
_responses1xxback to summary
pack-priv transient int _responses1xx
_responses2xxback to summary
pack-priv transient int _responses2xx
_responses3xxback to summary
pack-priv transient int _responses3xx
_responses4xxback to summary
pack-priv transient int _responses4xx
_responses5xxback to summary
pack-priv transient int _responses5xx
_responsesBytesTotalback to summary
pack-priv transient long _responsesBytesTotal
_statsStartedAtback to summary
pack-priv transient long _statsStartedAt

Constructor Detail

StatisticsHandlerback to summary
public StatisticsHandler()

Method Detail

addRequestsDurationTotalback to summary
private void addRequestsDurationTotal(long duration)
completeback to summary
public void complete(Request request)

Implements org.mortbay.jetty.handler.CompleteHandler.complete.

Handle completed requests.

Parameters
request:Request

the request which has just completed

doStartback to summary
protected void doStart() throws Exception

Overrides org.mortbay.jetty.handler.HandlerWrapper.doStart.

doStopback to summary
protected void doStop() throws Exception

Overrides org.mortbay.jetty.handler.HandlerWrapper.doStop.

getRequestsback to summary
public int getRequests()
Returns:int

Get the number of requests handled by this context since last call of statsReset(), not counting resumed requests. If setStatsOn(false) then this is undefined.

getRequestsActiveback to summary
public int getRequestsActive()
Returns:int

Number of requests currently active. Undefined if setStatsOn(false).

getRequestsActiveDurationAveback to summary
public long getRequestsActiveDurationAve()
Returns:long

Average duration of request handling in milliseconds since statsReset() called. Undefined if setStatsOn(false).

getRequestsActiveDurationMaxback to summary
public long getRequestsActiveDurationMax()
Returns:long

Get maximum duration in milliseconds of request handling since statsReset() called. Undefined if setStatsOn(false).

getRequestsActiveDurationMinback to summary
public long getRequestsActiveDurationMin()
Returns:long

Returns the requestsActiveDurationMin.

getRequestsActiveDurationTotalback to summary
public long getRequestsActiveDurationTotal()
Returns:long

Returns the requestsActiveDurationTotal.

getRequestsActiveMaxback to summary
public int getRequestsActiveMax()
Returns:int

Maximum number of active requests since statsReset() called. Undefined if setStatsOn(false).

getRequestsActiveMinback to summary
public int getRequestsActiveMin()
Returns:int

Returns the requestsActiveMin.

getRequestsDurationAveback to summary
public long getRequestsDurationAve()
Returns:long

Average duration of request handling in milliseconds since statsReset() called. Undefined if setStatsOn(false).

getRequestsDurationMaxback to summary
public long getRequestsDurationMax()
Returns:long

Get maximum duration in milliseconds of request handling since statsReset() called. Undefined if setStatsOn(false).

getRequestsDurationMinback to summary
public long getRequestsDurationMin()
Returns:long

Returns the requestsDurationMin.

getRequestsDurationTotalback to summary
public long getRequestsDurationTotal()
Returns:long

Returns the requestsDurationTotal.

getRequestsResumedback to summary
public int getRequestsResumed()
Returns:int

Number of requests that have been resumed. Undefined if setStatsOn(false).

getRequestsTimedoutback to summary
public int getRequestsTimedout()
Returns:int

Number of requests that timed out while suspended. Undefined if setStatsOn(false).

getResponses1xxback to summary
public int getResponses1xx()
Returns:int

Get the number of responses with a 2xx status returned by this context since last call of statsReset(). Undefined if if setStatsOn(false).

getResponses2xxback to summary
public int getResponses2xx()
Returns:int

Get the number of responses with a 100 status returned by this context since last call of statsReset(). Undefined if if setStatsOn(false).

getResponses3xxback to summary
public int getResponses3xx()
Returns:int

Get the number of responses with a 3xx status returned by this context since last call of statsReset(). Undefined if if setStatsOn(false).

getResponses4xxback to summary
public int getResponses4xx()
Returns:int

Get the number of responses with a 4xx status returned by this context since last call of statsReset(). Undefined if if setStatsOn(false).

getResponses5xxback to summary
public int getResponses5xx()
Returns:int

Get the number of responses with a 5xx status returned by this context since last call of statsReset(). Undefined if if setStatsOn(false).

getResponsesBytesTotalback to summary
public long getResponsesBytesTotal()
Returns:long

Total bytes of content sent in responses

getStatsOnMsback to summary
public long getStatsOnMs()
Returns:long

Timestamp stats were started at.

handleback to summary
public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException

Overrides org.mortbay.jetty.handler.HandlerWrapper.handle.

Implements org.mortbay.jetty.Handler.handle.

Doc from org.mortbay.jetty.Handler.handle.

Handle a request.

Parameters
target:String

The target of the request - either a URI or a name.

request:HttpServletRequest

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:HttpServletResponse

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:int

The dispatch mode: REQUEST, FORWARD, INCLUDE, ERROR

statsResetback to summary
public void statsReset()