Class StatisticsHandler
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 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.DumpableContainer, org.eclipse.jetty.util.component.Dumpable.DumpAppendableNested classes/interfaces inherited from interface 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.ListenerNested classes/interfaces inherited from interface Request.Handler
Request.Handler.AbortException -
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
LEGENDFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()voiddump(Appendable out, String indent) longlongintintintlongdoubledoublelongintintintDeprecated.intintlongdoubledoublelongintintintintintintprotected voidonAfterHandling(Request request, boolean handled, Throwable failure) Invoked after application handling (i.e. just after the call to theRunnablereturned fromHttpChannel.onRequest(MetaData.Request)returns).protected voidonBeforeHandling(Request request) Invoked just before calling the server handler tree (i.e. just before theRunnablereturned fromHttpChannel.onRequest(MetaData.Request)is run).protected voidonComplete(Request request, int status, org.eclipse.jetty.http.HttpFields headers, Throwable failure) Invoked 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).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. from within a call toRequest.read()).protected voidonResponseWrite(Request request, boolean last, ByteBuffer content) Invoked before each response content chunk has been written (i.e. from within the any call toResponse.write(boolean, ByteBuffer, Callback)).voidreset()Methods inherited from class EventsHandler
handle, onComplete, onResponseBegin, onResponseTrailersComplete, onResponseWriteCompleteMethods inherited from class Handler.Wrapper
getHandler, getInvocationType, setHandlerMethods inherited from class Handler.AbstractContainer
findContainerOf, getDescendant, getDescendants, isDynamic, setDynamic, setServerMethods inherited from class Handler.Abstract
destroy, 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, installBean, installBean, 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 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 Handler.Container
getContainer, getDescendant, getDescendants, getDescendantsMethods inherited from interface 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
-
doStart
- Overrides:
doStartin classHandler.Abstract- Throws:
Exception
-
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:
-
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
protected void onComplete(Request request, int status, org.eclipse.jetty.http.HttpFields headers, Throwable failure) 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.status- the response status.headers- the immutable fields of the response object.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
Deprecated.usegetRequestTotal()instead. -
getRequestTotal
@ManagedAttribute("total number of requests") public int getRequestTotal() -
getRequestsActive
@ManagedAttribute("current number of active requests") public int getRequestsActive() -
getRequestsActiveMax
@ManagedAttribute("maximum number of active requests") public int getRequestsActiveMax() -
getRequestTimeTotal
@ManagedAttribute("total time spent in request execution (in ns)") public long getRequestTimeTotal() -
getRequestTimeMax
@ManagedAttribute("maximum request execution time (in ns)") public long getRequestTimeMax() -
getRequestTimeMean
@ManagedAttribute("mean request execution time (in ns)") public double getRequestTimeMean() -
getRequestTimeStdDev
@ManagedAttribute("standard deviation for request execution time (in ns)") public double getRequestTimeStdDev() -
getHandleTotal
@ManagedAttribute("total number of calls to handle()") public int getHandleTotal() -
getHandleActive
@ManagedAttribute("current number of requests in handle()") public int getHandleActive() -
getHandleActiveMax
@ManagedAttribute("maximum number of requests in handle()") public int getHandleActiveMax() -
getHandleTimeMax
@ManagedAttribute("maximum handle() execution time (in ns)") public long getHandleTimeMax() -
getHandleTimeTotal
@ManagedAttribute("total time spent in handle() execution (in ns)") public long getHandleTimeTotal() -
getHandleTimeMean
@ManagedAttribute("mean handle() execution time (in ns)") public double getHandleTimeMean() -
getHandleTimeStdDev
@ManagedAttribute("standard deviation for handle() execution time (in ns)") public double getHandleTimeStdDev() -
getFailures
@ManagedAttribute("number of failed requests") public int getFailures() -
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 from handle()") public int getHandlingFailures() -
getBytesRead
@ManagedAttribute("bytes read count") public long getBytesRead() -
getBytesWritten
@ManagedAttribute("bytes written count") public long getBytesWritten() -
getStatisticsDuration
@ManagedAttribute("duration for which statistics have been collected") public Duration getStatisticsDuration()
-
getRequestTotal()instead.