Top Description Methods
io.vertx.core.spi.metrics

public Interface TCPMetrics<S>

extends NetworkMetrics<S>
Known Direct Subinterfaces
io.vertx.core.spi.metrics.HttpClientMetrics, io.vertx.core.spi.metrics.HttpServerMetrics
Known Direct Implementers
io.vertx.core.metrics.impl.DummyVertxMetrics.DummyTCPMetrics
Imports
io.vertx.core.net.SocketAddress

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 io.vertx.core.spi.metrics.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

Modifier and TypeMethod and Description
public default S

Returns:

the socket metric
connected
(SocketAddress
the remote address of the client
remoteAddress
,
String
the remote name of the client
remoteName
)

Called when a client has connected, which is applicable for TCP connections.

public default void
disconnected(S
the socket metric
socketMetric
,
SocketAddress
the remote address of the client
remoteAddress
)

Called when a client has disconnected, which is applicable for TCP connections.

Inherited from io.vertx.core.spi.metrics.NetworkMetrics:
bytesReadbytesWrittenexceptionOccurred

Method Detail

connectedback to summary
public default S connected(SocketAddress remoteAddress, String remoteName)

Called when a client has connected, which is applicable for TCP connections.

The remote name of the client is a best effort to provide the name of the remote host, i.e if the name is specified at creation time, this name will be used otherwise it will be the remote address.

Parameters
remoteAddress:SocketAddress

the remote address of the client

remoteName:String

the remote name of the client

Returns:S

the socket metric

disconnectedback to summary
public default void disconnected(S socketMetric, SocketAddress remoteAddress)

Called when a client has disconnected, which is applicable for TCP connections.

Parameters
socketMetric:S

the socket metric

remoteAddress:SocketAddress

the remote address of the client