Package io.vertx.core.spi.metrics
Interface ClientMetrics<M,βReq,βResp>
-
- All Superinterfaces:
Metrics
public interface ClientMetrics<M,βReq,βResp> extends 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 io.vertx.core.spi.metrics.Metrics
METRICS_ENABLED
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default MrequestBeginβ(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 Detail
-
requestBegin
default M requestBeginβ(String uri, Req request)
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:
uri- an arbitrary urirequest- the request object- Returns:
- the request metric
-
requestEnd
default void requestEndβ(M requestMetric)
CallsrequestEnd(Object, long)with-1L
-
requestEnd
default void requestEndβ(M requestMetric, long bytesWritten)
Called when the client request ends.- Parameters:
requestMetric- the request metricbytesWritten- the number of bytes written or-1when it is not known
-
responseBegin
default void responseBeginβ(M requestMetric, Resp response)
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
default void requestResetβ(M requestMetric)
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
default void responseEndβ(M requestMetric)
CallsresponseEnd(Object, long)with-1L
-
responseEnd
default void responseEndβ(M requestMetric, long bytesRead)
Called when the client response has ended- Parameters:
requestMetric- the request metricbytesRead- the number of bytes read or-1when it is not known
-
-