Class VertxNetworkMetrics

  • All Implemented Interfaces:
    io.vertx.core.spi.metrics.Metrics, io.vertx.core.spi.metrics.NetworkMetrics<Map<String,​Object>>
    Direct Known Subclasses:
    VertxTcpMetrics

    public class VertxNetworkMetrics
    extends Object
    implements io.vertx.core.spi.metrics.NetworkMetrics<Map<String,​Object>>
    NetworkMetrics
    • S for Socket metric -- Vert.x Context
    • Field Detail

      • registry

        final io.micrometer.core.instrument.MeterRegistry registry
      • nameBytesRead

        final String nameBytesRead
      • nameBytesWritten

        final String nameBytesWritten
      • nameExceptionOccurred

        final String nameExceptionOccurred
    • Constructor Detail

      • VertxNetworkMetrics

        VertxNetworkMetrics​(io.micrometer.core.instrument.MeterRegistry registry,
                            String prefix)
    • Method Detail

      • bytesRead

        public void bytesRead​(Map<String,​Object> socketMetric,
                              io.vertx.core.net.SocketAddress remoteAddress,
                              long numberOfBytes)
        Called when bytes have been read
        Specified by:
        bytesRead in interface io.vertx.core.spi.metrics.NetworkMetrics<Map<String,​Object>>
        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

        public void bytesWritten​(Map<String,​Object> socketMetric,
                                 io.vertx.core.net.SocketAddress remoteAddress,
                                 long numberOfBytes)
        Called when bytes have been written
        Specified by:
        bytesWritten in interface io.vertx.core.spi.metrics.NetworkMetrics<Map<String,​Object>>
        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

        public void exceptionOccurred​(Map<String,​Object> socketMetric,
                                      io.vertx.core.net.SocketAddress remoteAddress,
                                      Throwable t)
        Called when exceptions occur for a specific connection.
        Specified by:
        exceptionOccurred in interface io.vertx.core.spi.metrics.NetworkMetrics<Map<String,​Object>>
        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