Interface ClientMetrics<M,Req,Resp>
- All Superinterfaces:
Metrics
The client metrics SPI that Vert.x will use to call when client events occur.
- Author:
- Julien Viet
-
Field Summary
Fields inherited from interface Metrics
METRICS_ENABLED -
Method Summary
Modifier and TypeMethodDescriptiondefault voidCalled when a connection to the service is created, this can be called multiple times.default voidCalled when a connection to the service is closed.default Minit()Create a request metric instance.default voidrequestBegin(M requestMetric, String uri, Req request) Called when a client request begins.default voidrequestEnd(M requestMetric) CallsrequestEnd(Object, long)with-1Ldefault voidrequestEnd(M requestMetric, long bytesWritten) Called when the client request ends.default voidrequestReset(M requestMetric) Called when the client request couldn't complete successfully, for instance the connection was closed before the response was received.default voidresponseBegin(M requestMetric, Resp response) Called when the client response begins.default voidresponseEnd(M requestMetric) CallsresponseEnd(Object, long)with-1Ldefault voidresponseEnd(M requestMetric, long bytesRead) Called when the client response has ended
-
Method Details
-
init
-
requestBegin
Called when a client request begins. Vert.x will invokerequestEnd(M)when the request has ended orrequestReset(M)if the request/response has failed before.The request uri is an arbitrary URI that depends on the client, e.g. an HTTP request uri, a SQL query, etc...
- Parameters:
requestMetric- the request metricuri- an arbitrary urirequest- the request object
-
requestEnd
CallsrequestEnd(Object, long)with-1L -
requestEnd
Called when the client request ends.- Parameters:
requestMetric- the request metricbytesWritten- the number of bytes written or-1when it is not known
-
responseBegin
Called when the client response begins. Vert.x will invokeresponseEnd(M)when the response has ended orrequestReset(M)if the request/response has failed before.- Parameters:
requestMetric- the request metricresponse- the response object
-
requestReset
Called when the client request couldn't complete successfully, for instance the connection was closed before the response was received.- Parameters:
requestMetric- the request metric
-
responseEnd
CallsresponseEnd(Object, long)with-1L -
responseEnd
Called when the client response has ended- Parameters:
requestMetric- the request metricbytesRead- the number of bytes read or-1when it is not known
-
connected
default void connected()Called when a connection to the service is created, this can be called multiple times. -
disconnected
default void disconnected()Called when a connection to the service is closed.
-