java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.Handler.Abstract
org.eclipse.jetty.server.Handler.AbstractContainer
org.eclipse.jetty.server.Handler.Wrapper
org.eclipse.jetty.server.handler.EventsHandler
org.eclipse.jetty.server.handler.StatisticsHandler
- All Implemented Interfaces:
Handler,Handler.Container,Handler.Singleton,Request.Handler,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle,org.eclipse.jetty.util.thread.Invocable
- Direct Known Subclasses:
StatisticsHandler.MinimumDataRateHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classChecks that the wrapped handler can read/write at a minimal rate of N bytes per second.Nested classes/interfaces inherited from class org.eclipse.jetty.server.Handler.Abstract
Handler.Abstract.NonBlockingNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.server.Handler
Handler.Abstract, Handler.AbstractContainer, Handler.Collection, Handler.Container, Handler.Sequence, Handler.Singleton, Handler.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
org.eclipse.jetty.util.thread.Invocable.Callable, org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEYFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(Appendable out, String indent) longlongintintintintlongdoubledoublelongintintintintintprotected voidonAfterHandling(Request request, boolean handled, Throwable failure) Invoked after application handling (i.e.protected voidonBeforeHandling(Request request) Invoked just before calling the server handler tree (i.e.protected voidonComplete(Request request, Throwable failure) Invoked when the request and response processing are complete, just before the request and response will be recycled (i.e.protected voidonRequestRead(Request request, org.eclipse.jetty.io.Content.Chunk chunk) Invoked every time a request content chunk has been parsed, just before making it available to the application (i.e.protected voidonResponseBegin(Request request, int status, org.eclipse.jetty.http.HttpFields headers) Invoked just before the response is line written to the network (i.e.protected voidonResponseWrite(Request request, boolean last, ByteBuffer content) Invoked before each response content chunk has been written (i.e.voidreset()Methods inherited from class org.eclipse.jetty.server.handler.EventsHandler
handle, onResponseTrailersComplete, onResponseWriteCompleteMethods inherited from class org.eclipse.jetty.server.Handler.Wrapper
getHandler, getInvocationType, setHandlerMethods inherited from class org.eclipse.jetty.server.Handler.AbstractContainer
findContainerOf, getDescendant, getDescendants, isDynamic, setDynamic, setServerMethods inherited from class org.eclipse.jetty.server.Handler.Abstract
destroy, doStart, doStop, getServerMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Destroyable
destroyMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.server.Handler.Container
getContainer, getDescendant, getDescendants, getDescendantsMethods inherited from interface org.eclipse.jetty.server.Handler.Singleton
getHandlers, getTail, insertHandler, setHandlerMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
-
Constructor Details
-
StatisticsHandler
public StatisticsHandler() -
StatisticsHandler
-
-
Method Details
-
onBeforeHandling
Description copied from class:EventsHandlerInvoked just before calling the server handler tree (i.e. just before theRunnablereturned fromHttpChannel.onRequest(MetaData.Request)is run).This is the final state of the request before the handlers are called. This includes any request customization.
- Overrides:
onBeforeHandlingin classEventsHandler- Parameters:
request- the request object. Theread(),demand(Runnable)andfail(Throwable)methods must not be called by the listener.- See Also:
-
onAfterHandling
Description copied from class:EventsHandlerInvoked after application handling (i.e. just after the call to theRunnablereturned fromHttpChannel.onRequest(MetaData.Request)returns).- Overrides:
onAfterHandlingin classEventsHandler- Parameters:
request- the request object. Theread(),demand(Runnable)andfail(Throwable)methods must not be called by the listener.handled- if the server handlers handled the requestfailure- the exception thrown by the application- See Also:
-
onRequestRead
Description copied from class:EventsHandlerInvoked every time a request content chunk has been parsed, just before making it available to the application (i.e. from within a call toRequest.read()).- Overrides:
onRequestReadin classEventsHandler- Parameters:
request- the request object. Theread(),demand(Runnable)andfail(Throwable)methods must not be called by the listener.chunk- a potentially null request content chunk, includingerrorandTrailerschunks. If a reference to the chunk (or itsByteBuffer) is kept, thenRetainable.retain()must be called.- See Also:
-
onResponseBegin
protected void onResponseBegin(Request request, int status, org.eclipse.jetty.http.HttpFields headers) Description copied from class:EventsHandlerInvoked just before the response is line written to the network (i.e. from within the first call toResponse.write(boolean, ByteBuffer, Callback)).- Overrides:
onResponseBeginin classEventsHandler- Parameters:
request- the request object. Theread(),demand(Runnable)andfail(Throwable)methods must not be called by the listener.status- the response statusheaders- the immutable fields of the response object- See Also:
-
onResponseWrite
Description copied from class:EventsHandlerInvoked before each response content chunk has been written (i.e. from within the any call toResponse.write(boolean, ByteBuffer, Callback)).- Overrides:
onResponseWritein classEventsHandler- Parameters:
request- the request object. Theread(),demand(Runnable)andfail(Throwable)methods must not be called by the listener.last- indicating last writecontent- TheByteBufferof the response content chunk (readonly).- See Also:
-
onComplete
Description copied from class:EventsHandlerInvoked when the request and response processing are complete, just before the request and response will be recycled (i.e. after theRunnablereturn fromHttpChannel.onRequest(MetaData.Request)has returned and theCallbackpassed toRequest.Handler.handle(Request, Response, Callback)has been completed).- Overrides:
onCompletein classEventsHandler- Parameters:
request- the request object. Theread(),demand(Runnable)andfail(Throwable)methods must not be called by the listener.failure- if there was a failure to complete
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Overrides:
dumpin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
IOException
-
reset
@ManagedOperation(value="resets the statistics", impact="ACTION") public void reset() -
getRequests
@ManagedAttribute("number of requests") public int getRequests() -
getRequestsActive
@ManagedAttribute("number of requests currently active") public int getRequestsActive() -
getRequestsActiveMax
@ManagedAttribute("maximum number of active requests") public int getRequestsActiveMax() -
getResponses1xx
@ManagedAttribute("number of requests with 1xx response status") public int getResponses1xx() -
getResponses2xx
@ManagedAttribute("number of requests with 2xx response status") public int getResponses2xx() -
getResponses3xx
@ManagedAttribute("number of requests with 3xx response status") public int getResponses3xx() -
getResponses4xx
@ManagedAttribute("number of requests with 4xx response status") public int getResponses4xx() -
getResponses5xx
@ManagedAttribute("number of requests with 5xx response status") public int getResponses5xx() -
getHandlingFailures
@ManagedAttribute("number of requests that threw an exception during handling") public int getHandlingFailures() -
getRequestTimeTotal
@ManagedAttribute("total time spend in all request execution (in ns)") public long getRequestTimeTotal() -
getRequestTimeMax
@ManagedAttribute("maximum time spend executing requests (in ns)") public long getRequestTimeMax() -
getRequestTimeMean
@ManagedAttribute("mean time spent executing requests (in ns)") public double getRequestTimeMean() -
getRequestTimeStdDev
@ManagedAttribute("standard deviation for request execution (in ns)") public double getRequestTimeStdDev() -
getBytesRead
@ManagedAttribute("bytes read count") public long getBytesRead() -
getBytesWritten
@ManagedAttribute("bytes written count") public long getBytesWritten()
-