io.vertx.core.spi.metrics

## Interface HttpClientMetrics<R,W,S>

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

      public interface HttpClientMetrics<R,W,S>
      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
    --- | ---
    `W` | `connected(S socketMetric, WebSocket webSocket)` Called when a web socket connects.
    `void` | `disconnected(W webSocketMetric)` Called when the web socket has disconnected.
    `R` | `requestBegin(S socketMetric, SocketAddress localAddress, SocketAddress remoteAddress, HttpClientRequest request)` Called when an http client request begins
    `void` | `responseEnd(R requestMetric, HttpClientResponse response)` Called when an http client response has ended

    - ### 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

    - #### requestBegin

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

      Called when an http client request begins
      Parameters:
        `socketMetric` - the socket metric
        `localAddress` - the local address
        `remoteAddress` - the remote address
        `request` - the `HttpClientRequest`
      Returns:
        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(S socketMetric,
                      WebSocket webSocket)

      Called when a web socket connects.
      Parameters:
        `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 © 2015. All rights reserved.