io.vertx.core.spi.metrics

## Interface TCPMetrics<S>

- All Superinterfaces:
    Metrics, NetworkMetrics<S>
  All Known Subinterfaces:
    HttpClientMetrics<R,W,S>, HttpServerMetrics<R,W,S>

      public interface TCPMetrics<S>
      extends NetworkMetrics<S>

  An SPI used internally by Vert.x to gather metrics on a net socket which serves as a base class for things like HttpServer and HttpClient, all of which serve TCP connections.

  The thread model for the tcp metrics depends on the actual context thats created the client/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 client/server 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
    --- | ---
    `S` | `connected(SocketAddress remoteAddress)` Called when a client has connected, which is applicable for TCP connections.
    `void` | `disconnected(S socketMetric, SocketAddress remoteAddress)` Called when a client has disconnected, which is applicable for TCP connections.

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

    - #### connected

          S connected(SocketAddress remoteAddress)

      Called when a client has connected, which is applicable for TCP connections.
      Parameters:
        `remoteAddress` - the remote address of the client
      Returns:
        the socket metric

    - #### disconnected

          void disconnected(S socketMetric,
                            SocketAddress remoteAddress)

      Called when a client has disconnected, which is applicable for TCP connections.
      Parameters:
        `socketMetric` - the socket metric
        `remoteAddress` - the remote address of the client

Copyright © 2015. All rights reserved.