Interface HttpServerMetrics<R,W>
- All Superinterfaces:
Metrics, WebSocketMetrics<W>
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 theVertxMetrics 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
-
Field Summary
Fields inherited from interface Metrics
METRICS_ENABLED -
Method Summary
Modifier and TypeMethodDescriptiondefault Wconnected(HttpRequest request) Called when a server web socket connects.default voiddisconnected(W webSocketMetric) Called when the server web socket has disconnected.default RrequestBegin(SocketAddress remoteAddress, HttpRequest request) Called when an http server request begins.default voidrequestEnd(R requestMetric, HttpRequest request, long bytesRead) Called when an http server request has ended.default voidrequestReset(R requestMetric) Called when the http server request couldn't complete successfully, for instance the connection was closed before the response was sent.default voidrequestRouted(R requestMetric, String route) Called when a routing layer indicates a request has been routed.default voidrequestUpgraded(R requestMetrics) Called when an http server request is upgraded, e.g. a WebSocketdefault voidresponseBegin(R requestMetric, HttpResponse response) Called when an http server response begins.default voidresponseEnd(R requestMetric, HttpResponse response, long bytesWritten) Called when an http server response has ended.default RresponsePushed(SocketAddress remoteAddress, HttpMethod method, String uri, HttpResponse response) Called when an http server response is pushed.
-
Method Details
-
requestBegin
Called when an http server request begins. Vert.x will invokeresponseEnd(R, HttpResponse, long)when the response has ended orrequestReset(R)if the request/response has failed before.- Parameters:
remoteAddress- the client remote addressrequest- the http server request- Returns:
- the request metric
-
requestEnd
Called when an http server request has ended.- Parameters:
requestMetric- the request metricrequest- the sameHttpRequestprovided in the initial response callbackbytesRead- the total number of bytes read
-
requestReset
Called when the http server request couldn't complete successfully, for instance the connection was closed before the response was sent.- Parameters:
requestMetric- the request metric
-
requestUpgraded
Called when an http server request is upgraded, e.g. a WebSocket- Parameters:
requestMetrics- the request metric
-
responseBegin
Called when an http server response begins.- Parameters:
requestMetric- the request metricresponse- the http server request
-
responsePushed
default R responsePushed(SocketAddress remoteAddress, HttpMethod method, String uri, HttpResponse response) Called when an http server response is pushed.- Parameters:
remoteAddress- the client remote addressmethod- the pushed response methoduri- the pushed response uriresponse- the http server response @return the request metric
-
responseEnd
Called when an http server response has ended.- Parameters:
requestMetric- the request metricresponse- the sameHttpResponseprovided in the initial response callbackbytesWritten- the total number of bytes written
-
connected
Called when a server web socket connects.- Specified by:
connectedin interfaceWebSocketMetrics<R>- Parameters:
request- the observable request- Returns:
- the server web socket metric
-
disconnected
Called when the server web socket has disconnected.- Specified by:
disconnectedin interfaceWebSocketMetrics<R>- Parameters:
webSocketMetric- the server web socket metric
-
requestRouted
-