Interface NetworkMetrics<C>

All Superinterfaces:
Metrics
All Known Subinterfaces:
DatagramSocketMetrics, TCPMetrics<C>, TransportMetrics<C>

public interface NetworkMetrics<C> extends Metrics
An SPI used internally by Vert.x to gather metrics on a net socket which serves as a base class for TCP, UDP or QUIC.

Author:
Nick Scavelli
  • Field Summary

    Fields inherited from interface Metrics

    METRICS_ENABLED
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    bytesRead(C connectionMetric, SocketAddress remoteAddress, long numberOfBytes)
    Called when bytes have been read
    default void
    bytesWritten(C connectionMetric, SocketAddress remoteAddress, long numberOfBytes)
    Called when bytes have been written
    default void
    exceptionOccurred(C connectionMetric, SocketAddress remoteAddress, Throwable err)
    Called when exceptions occur for a specific connection.

    Methods inherited from interface Metrics

    close
  • Method Details

    • bytesRead

      default void bytesRead(C connectionMetric, SocketAddress remoteAddress, long numberOfBytes)
      Called when bytes have been read
      Parameters:
      connectionMetric - the connection metric, null for UDP
      remoteAddress - the remote address which this socket received bytes from
      numberOfBytes - the number of bytes read
    • bytesWritten

      default void bytesWritten(C connectionMetric, SocketAddress remoteAddress, long numberOfBytes)
      Called when bytes have been written
      Parameters:
      connectionMetric - the connection metric, null for UDP
      remoteAddress - the remote address which bytes are being written to
      numberOfBytes - the number of bytes written
    • exceptionOccurred

      default void exceptionOccurred(C connectionMetric, SocketAddress remoteAddress, Throwable err)
      Called when exceptions occur for a specific connection.
      Parameters:
      connectionMetric - the connection metric, null for UDP
      remoteAddress - the remote address of the connection or null if it's datagram/udp
      err - the exception that occurred