- All Known Implementing Classes:
CountingInstrumenter,ThreadSafeCountingInstrumenter
public interface Instrumenter
A generic interface that allows the HTTP Server to be instrumented.
- Author:
- Brian Pontarelli
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when a new client connection is accepted by the HTTP server.voidCalled when a new request is accepted by an HTTP worker.voidCalled when a client sends in a bad HTTP request.voidCalled when a client sends in chunked request data.voidCalled when a client sends in chunked request data.voidCalled when a connection is closed due to an issue or a timeout.voidreadFromClient(long bytes) Called when bytes are read from a client.voidCalled when the server listener is started.voidSignals that an HTTP worker has been started.voidSignals that an HTTP worker has been stopped.voidwroteToClient(long bytes) Called when bytes are written to a client.
-
Method Details
-
acceptedConnection
void acceptedConnection()Called when a new client connection is accepted by the HTTP server. -
acceptedRequest
void acceptedRequest()Called when a new request is accepted by an HTTP worker. -
badRequest
void badRequest()Called when a client sends in a bad HTTP request. A bad request is one that cannot be handled by the HTTP server. -
chunkedRequest
void chunkedRequest()Called when a client sends in chunked request data. -
chunkedResponse
void chunkedResponse()Called when a client sends in chunked request data. -
connectionClosed
void connectionClosed()Called when a connection is closed due to an issue or a timeout. This should not count connections closed in expected conditions such as a keep-alive timeout. -
readFromClient
void readFromClient(long bytes) Called when bytes are read from a client.- Parameters:
bytes- The number of bytes read.
-
serverStarted
void serverStarted()Called when the server listener is started. If you have a single listener, you will have one server started. If you have two listeners, one for HTTP and one for HTTPS, you will have two servers started. -
workerStarted
void workerStarted()Signals that an HTTP worker has been started. -
workerStopped
void workerStopped()Signals that an HTTP worker has been stopped. -
wroteToClient
void wroteToClient(long bytes) Called when bytes are written to a client.- Parameters:
bytes- The number of bytes written.
-