io.vertx.core.spi.metrics

## Interface NetworkMetrics<S>

- All Superinterfaces:
    Metrics
  All Known Subinterfaces:
    DatagramSocketMetrics, HttpClientMetrics<R,W,S,T>, 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

- - ### Field Summary

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

      `DISABLE_METRICS_PROPERTY_NAME, METRICS_ENABLED`

  - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default void` | `bytesRead(S socketMetric, SocketAddress remoteAddress, long numberOfBytes)` Called when bytes have been read
    `default void` | `bytesWritten(S socketMetric, SocketAddress remoteAddress, long numberOfBytes)` Called when bytes have been written
    `default 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`

- - ### Method Detail

    - #### bytesRead

          default 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

          default 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

          default 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 © 2024 Eclipse. All rights reserved.