io.vertx.core.spi.metrics

## Interface NetworkMetrics<S>

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

      public interface NetworkMetrics<S>
      extends Metrics

  An SPI used internally by Vert.x to gather metrics on a net socket which serves as a base class for TCP or UDP.

  Author:
    Nick Scavelli

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `bytesRead(S socketMetric, SocketAddress remoteAddress, long numberOfBytes)` Called when bytes have been read
    `void` | `bytesWritten(S socketMetric, SocketAddress remoteAddress, long numberOfBytes)` Called when bytes have been written
    `void` | `exceptionOccurred(S socketMetric, SocketAddress remoteAddress, Throwable t)` Called when exceptions occur for a specific connection.

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

      `close, isEnabled`

- - ### Method Detail

    - #### bytesRead

          void bytesRead(S socketMetric,
                         SocketAddress remoteAddress,
                         long numberOfBytes)

      Called when bytes have been read
      Parameters:
        `socketMetric` - the socket metric, null for UDP
        `remoteAddress` - the remote address which this socket received bytes from
        `numberOfBytes` - the number of bytes read

    - #### bytesWritten

          void bytesWritten(S socketMetric,
                            SocketAddress remoteAddress,
                            long numberOfBytes)

      Called when bytes have been written
      Parameters:
        `socketMetric` - the socket metric, null for UDP
        `remoteAddress` - the remote address which bytes are being written to
        `numberOfBytes` - the number of bytes written

    - #### exceptionOccurred

          void exceptionOccurred(S socketMetric,
                                 SocketAddress remoteAddress,
                                 Throwable t)

      Called when exceptions occur for a specific connection.
      Parameters:
        `socketMetric` - the socket metric, null for UDP
        `remoteAddress` - the remote address of the connection or null if it's datagram/udp
        `t` - the exception that occurred

Copyright © 2015. All Rights Reserved.