Top Description Methods
io.vertx.core.spi.metrics

public Interface HttpServerMetrics<R, W, S>

extends TCPMetrics<S>
Known Direct Implementers
io.vertx.core.metrics.impl.DummyVertxMetrics.DummyHttpServerMetrics
Imports
io.vertx.core.http.HttpMethod, .ServerWebSocket, io.vertx.core.spi.observability.HttpRequest, .HttpResponse

The http server metrics SPI that Vert.x will use to call when each http server event occurs.

The thread model for the http server metrics depends on the actual context thats started the server.

Event loop context

Unless specified otherwise, all the methods on this object including the methods inherited from the super interfaces are invoked with the thread of the http server and therefore are the same than the io.vertx.core.spi.metrics.VertxMetrics createMetrics method that created and returned this metrics object.

Worker context

Unless specified otherwise, all the methods on this object including the methods inherited from the super interfaces are invoked with a worker thread.
Author
Nick Scavelli

Method Summary

Modifier and TypeMethod and Description
public default W

Returns:

the server web socket metric
connected
(S
the socket metric
socketMetric
,
R
the request metric
requestMetric
,
ServerWebSocket
the server web socket
serverWebSocket
)

Called when a server web socket connects.

public default void
disconnected(W
the server web socket metric
serverWebSocketMetric
)

Called when the server web socket has disconnected.

public default R

Returns:

the request metric
requestBegin
(S
the socket metric
socketMetric
,
HttpRequest
the http server reuqest
request
)

Called when an http server request begins.

public default void
requestEnd(R
the request metric
requestMetric
,
HttpRequest
the same HttpRequest provided in the initial response callback
request
,
long
the total number of bytes read
bytesRead
)

Called when an http server request has ended.

public default void
requestReset(R
the request metric
requestMetric
)

Called when the http server request couldn't complete successfully, for instance the connection was closed before the response was sent.

public default void
requestRouted(R
the request metric
requestMetric
,
String
the route the request has been routed to
route
)

Called when a routing layer indicates a request has been routed.

public default void
responseBegin(R
the request metric
requestMetric
,
HttpResponse
the http server request
response
)

Called when an http server response begins.

public default void
responseEnd(R
the request metric
requestMetric
,
HttpResponse
the same HttpResponse provided in the initial response callback
response
,
long
the total number of bytes written
bytesWritten
)

Called when an http server response has ended.

public default R
responsePushed(S
the socket metric
socketMetric
,
HttpMethod
the pushed response method
method
,
String
the pushed response uri
uri
,
HttpResponse
the http server response @return the request metric
response
)

Called when an http server response is pushed.

Inherited from io.vertx.core.spi.metrics.TCPMetrics:
connecteddisconnected

Method Detail

connectedback to summary
public default W connected(S socketMetric, R requestMetric, ServerWebSocket serverWebSocket)

Called when a server web socket connects.

Parameters
socketMetric:S

the socket metric

requestMetric:R

the request metric

serverWebSocket:ServerWebSocket

the server web socket

Returns:W

the server web socket metric

disconnectedback to summary
public default void disconnected(W serverWebSocketMetric)

Called when the server web socket has disconnected.

Parameters
serverWebSocketMetric:W

the server web socket metric

requestBeginback to summary
public default R requestBegin(S socketMetric, HttpRequest request)

Called when an http server request begins. Vert.x will invoke responseEnd when the response has ended or requestReset if the request/response has failed before.

Parameters
socketMetric:S

the socket metric

request:HttpRequest

the http server reuqest

Returns:R

the request metric

requestEndback to summary
public default void requestEnd(R requestMetric, HttpRequest request, long bytesRead)

Called when an http server request has ended.

Parameters
requestMetric:R

the request metric

request:HttpRequest

the same HttpRequest provided in the initial response callback

bytesRead:long

the total number of bytes read

requestResetback to summary
public default void requestReset(R requestMetric)

Called when the http server request couldn't complete successfully, for instance the connection was closed before the response was sent.

Parameters
requestMetric:R

the request metric

requestRoutedback to summary
public default void requestRouted(R requestMetric, String route)

Called when a routing layer indicates a request has been routed.

Parameters
requestMetric:R

the request metric

route:String

the route the request has been routed to

responseBeginback to summary
public default void responseBegin(R requestMetric, HttpResponse response)

Called when an http server response begins.

Parameters
requestMetric:R

the request metric

response:HttpResponse

the http server request

responseEndback to summary
public default void responseEnd(R requestMetric, HttpResponse response, long bytesWritten)

Called when an http server response has ended.

Parameters
requestMetric:R

the request metric

response:HttpResponse

the same HttpResponse provided in the initial response callback

bytesWritten:long

the total number of bytes written

responsePushedback to summary
public default R responsePushed(S socketMetric, HttpMethod method, String uri, HttpResponse response)

Called when an http server response is pushed.

Parameters
socketMetric:S

the socket metric

method:HttpMethod

the pushed response method

uri:String

the pushed response uri

response:HttpResponse

the http server response @return the request metric