Class StatisticsHandler
- All Implemented Interfaces:
Handler, Handler.Container, Handler.Singleton, Request.Handler, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle, 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 AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested 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 Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.TaskNested classes/interfaces inherited from interface LifeCycle
LifeCycle.ListenerNested classes/interfaces inherited from interface Request.Handler
Request.Handler.AbortException -
Field Summary
Fields inherited from interface Invocable
__nonBlocking, NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()Starts the managed lifecycle beans in the order they were added.voiddump(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.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, 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, 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 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 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 Container
getCachedBeans, getEventListenersMethods inherited from interface Destroyable
destroyMethods inherited from interface Dumpable.DumpableContainer
isDumpableMethods inherited from interface Handler.Container
getContainer, getDescendant, getDescendants, getDescendantsMethods inherited from interface Handler.Singleton
getHandlers, getTail, insertHandler, setHandlerMethods inherited from interface LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
-
Constructor Details
-
StatisticsHandler
public StatisticsHandler() -
StatisticsHandler
-
-
Method Details
-
doStart
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classHandler.Abstract- Throws:
Exception- If there was a problem starting. Will cause a transition to FAILED state
-
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
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
Description copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dumpin interfaceDumpable- Overrides:
dumpin classContainerLifeCycle- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-
reset
-
getRequests
Deprecated.usegetRequestTotal()instead. -
getRequestTotal
-
getRequestsActive
-
getRequestsActiveMax
-
getRequestTimeTotal
@ManagedAttribute("total time spent in request execution (in ns)") public long getRequestTimeTotal() -
getRequestTimeMax
-
getRequestTimeMean
-
getRequestTimeStdDev
@ManagedAttribute("standard deviation for request execution time (in ns)") public double getRequestTimeStdDev() -
getHandleTotal
-
getHandleActive
-
getHandleActiveMax
-
getHandleTimeMax
-
getHandleTimeTotal
@ManagedAttribute("total time spent in handle() execution (in ns)") public long getHandleTimeTotal() -
getHandleTimeMean
-
getHandleTimeStdDev
@ManagedAttribute("standard deviation for handle() execution time (in ns)") public double getHandleTimeStdDev() -
getFailures
-
getResponses1xx
-
getResponses2xx
-
getResponses3xx
-
getResponses4xx
-
getResponses5xx
-
getHandlingFailures
@ManagedAttribute("number of requests that threw an exception from handle()") public int getHandlingFailures() -
getBytesRead
-
getBytesWritten
-
getStatisticsDuration
@ManagedAttribute("duration for which statistics have been collected") public Duration getStatisticsDuration()
-
getRequestTotal()instead.