io.vertx.core.spi.metrics

## Interface HttpClientMetrics<R,W,S,E,T>

- All Superinterfaces:
    Metrics, NetworkMetrics<S>, TCPMetrics<S>

      public interface HttpClientMetrics<R,W,S,E,T>
      extends TCPMetrics<S>

  The http client metrics SPI that Vert.x will use to call when http client events occur.

  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 client and therefore are the same than the `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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeEndpoint(String host, int port, E endpointMetric)` Called when an endpoint is closed.
    `W` | `connected(E endpointMetric, S socketMetric, WebSocket webSocket)` Called when a web socket connects.
    `E` | `createEndpoint(String host, int port, int maxPoolSize)` Provides metrics for a particular endpoint
    `void` | `dequeueRequest(E endpointMetric, T taskMetric)` Called when a request for connection is satisfied.
    `void` | `disconnected(W webSocketMetric)` Called when the web socket has disconnected.
    `void` | `endpointConnected(E endpointMetric, S socketMetric)` Called when a connection is made to a endpoint.
    `void` | `endpointDisconnected(E endpointMetric, S socketMetric)` Called when a connection to an endpoint is closed.
    `T` | `enqueueRequest(E endpointMetric)` Called when a connection is requested.
    `R` | `requestBegin(E endpointMetric, S socketMetric, SocketAddress localAddress, SocketAddress remoteAddress, HttpClientRequest request)` Called when an http client request begins.
    `void` | `requestEnd(R requestMetric)` Callend when an http client request ends.
    `void` | `requestReset(R requestMetric)` Called when the http client request couldn't complete successfully, for instance the connection was closed before the response was received.
    `void` | `responseBegin(R requestMetric, HttpClientResponse response)` Called when an http client response begins.
    `void` | `responseEnd(R requestMetric, HttpClientResponse response)` Called when an http client response has ended
    `R` | `responsePushed(E endpointMetric, S socketMetric, SocketAddress localAddress, SocketAddress remoteAddress, HttpClientRequest request)` Called when an http client response is pushed.

    - ### Methods inherited from interface io.vertx.core.spi.metrics.TCPMetrics

      `connected, disconnected`

    - ### Methods inherited from interface io.vertx.core.spi.metrics.NetworkMetrics

      `bytesRead, bytesWritten, exceptionOccurred`

    - ### Methods inherited from interface io.vertx.core.spi.metrics.Metrics

      `close, isEnabled`

- - ### Method Detail

    - #### createEndpoint

          E createEndpoint(String host,
                           int port,
                           int maxPoolSize)

      Provides metrics for a particular endpoint
      Parameters:
        `host` - the endpoint host possibly unresolved
        `port` - the endpoint port
        `maxPoolSize` - the server max pool size
      Returns:
        the endpoint metric

    - #### closeEndpoint

          void closeEndpoint(String host,
                             int port,
                             E endpointMetric)

      Called when an endpoint is closed.
      Parameters:
        `host` - the server host
        `port` - the server port
        `endpointMetric` - the server metric returned by `createEndpoint(java.lang.String, int, int)`

    - #### enqueueRequest

          T enqueueRequest(E endpointMetric)

      Called when a connection is requested.
      Parameters:
        `endpointMetric` - the endpoint metric returned by `createEndpoint(java.lang.String, int, int)`

    - #### dequeueRequest

          void dequeueRequest(E endpointMetric,
                              T taskMetric)

      Called when a request for connection is satisfied.
      Parameters:
        `endpointMetric` - the endpoint metric returned by `createEndpoint(java.lang.String, int, int)`

    - #### endpointConnected

          void endpointConnected(E endpointMetric,
                                 S socketMetric)

      Called when a connection is made to a endpoint.
      Parameters:
        `endpointMetric` - the endpoint metric
        `socketMetric` - the socket metric

    - #### endpointDisconnected

          void endpointDisconnected(E endpointMetric,
                                    S socketMetric)

      Called when a connection to an endpoint is closed.
      Parameters:
        `endpointMetric` - the endpoint metric
        `socketMetric` - the socket metric

    - #### requestBegin

          R requestBegin(E endpointMetric,
                         S socketMetric,
                         SocketAddress localAddress,
                         SocketAddress remoteAddress,
                         HttpClientRequest request)

      Called when an http client request begins. Vert.x will invoke `requestEnd(R)` when the request has ended or `requestReset(R)` if the request/response has failed before.
      Parameters:
        `endpointMetric` - the endpoint metric
        `socketMetric` - the socket metric
        `localAddress` - the local address
        `remoteAddress` - the remote address
        `request` - the `HttpClientRequest`
      Returns:
        the request metric

    - #### requestEnd

          void requestEnd(R requestMetric)

      Callend when an http client request ends.
      Parameters:
        `requestMetric` - the request metric

    - #### responseBegin

          void responseBegin(R requestMetric,
                             HttpClientResponse response)

      Called when an http client response begins. Vert.x will invoke `responseEnd(R, io.vertx.core.http.HttpClientResponse)` when the response has ended or `requestReset(R)` if the request/response has failed before.
      Parameters:
        `requestMetric` - the request metric
        `response` - the `HttpClientResponse`

    - #### responsePushed

          R responsePushed(E endpointMetric,
                           S socketMetric,
                           SocketAddress localAddress,
                           SocketAddress remoteAddress,
                           HttpClientRequest request)

      Called when an http client response is pushed.
      Parameters:
        `endpointMetric` - the endpoint metric
        `socketMetric` - the socket metric
        `localAddress` - the local address
        `remoteAddress` - the remote address
        `request` - the http server request
      Returns:
        the request metric

    - #### requestReset

          void requestReset(R requestMetric)

      Called when the http client request couldn't complete successfully, for instance the connection was closed before the response was received.
      Parameters:
        `requestMetric` - the request metric

    - #### responseEnd

          void responseEnd(R requestMetric,
                           HttpClientResponse response)

      Called when an http client response has ended
      Parameters:
        `requestMetric` - the request metric
        `response` - the `HttpClientResponse`

    - #### connected

          W connected(E endpointMetric,
                      S socketMetric,
                      WebSocket webSocket)

      Called when a web socket connects.
      Parameters:
        `endpointMetric` - the endpoint metric
        `socketMetric` - the socket metric
        `webSocket` - the server web socket
      Returns:
        the web socket metric

    - #### disconnected

          void disconnected(W webSocketMetric)

      Called when the web socket has disconnected.
      Parameters:
        `webSocketMetric` - the web socket metric

Copyright © 2017. All rights reserved.