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

public Interface VertxMetrics

extends Metrics, Measured
Known Direct Implementers
io.vertx.core.metrics.impl.DummyVertxMetrics
Imports
io.vertx.core.Vertx, io.vertx.core.datagram.DatagramSocket, .DatagramSocketOptions, io.vertx.core.http.HttpClient, .HttpClientOptions, .HttpServer, .HttpServerOptions, io.vertx.core.metrics.Measured, io.vertx.core.net.*

The main Vert.x metrics SPI which Vert.x will use internally. This interface serves two purposes, one to be called by Vert.x itself for events like verticles deployed, timers created, etc. The other to provide Vert.x with other metrics SPI's which will be used for specific components i.e. io.vertx.core.http.HttpServer, io.vertx.core.spi.metrics.EventBusMetrics, etc.
Author
Nick Scavelli

Field Summary

Inherited from io.vertx.core.spi.metrics.Metrics:
DISABLE_METRICS_PROPERTY_NAMEMETRICS_ENABLED

Method Summary

Modifier and TypeMethod and Description
public default ClientMetrics<?, ?, ?, ?>

Returns:

the client metrics SPI or null when metrics are disabled
createClientMetrics
(SocketAddress
the server remote address
remoteAddress
,
String
the metrics type, e.g http or ws
type
,
String
an optional namespace for scoping the metrics
namespace
)

Provides the client metrics SPI when a client has been created.

public default DatagramSocketMetrics

Returns:

the datagram metrics SPI or null when metrics are disabled
createDatagramSocketMetrics
(DatagramSocketOptions
the options used to create the DatagramSocket
options
)

Provides the datagram/udp metrics SPI when a datagram socket is created.

public default EventBusMetrics<H>

Returns:

the event bus metrics SPI or null when metrics are disabled
createEventBusMetrics
()

Provides the event bus metrics SPI when the event bus is created.

public default HttpClientMetrics<?, ?, ?, ?>

Returns:

the http client metrics SPI or null when metrics are disabled
createHttpClientMetrics
(HttpClientOptions
the options used to create the HttpClient
options
)

Provides the http client metrics SPI when an http client has been created.

public default HttpServerMetrics<?, ?, ?>

Returns:

the http server metrics SPI or null when metrics are disabled
createHttpServerMetrics
(HttpServerOptions
the options used to create the HttpServer
options
,
SocketAddress
localAddress the local address the net socket is listening on
localAddress
)

Provides the http server metrics SPI when an http server is created.

public default TCPMetrics<?>

Returns:

the net client metrics SPI or null when metrics are disabled
createNetClientMetrics
(NetClientOptions
the options used to create the NetClient
options
)

Provides the net client metrics SPI when a net client is created.

public default TCPMetrics<?>

Returns:

the net server metrics SPI or null when metrics are disabled
createNetServerMetrics
(NetServerOptions
the options used to create the NetServer
options
,
SocketAddress
localAddress the local address the net socket is listening on
localAddress
)

Provides the net server metrics SPI when a net server is created.

public default PoolMetrics<?>

Returns:

the thread pool metrics SPI or null when metrics are disabled
createPoolMetrics
(String
the type of the pool e.g worker, datasource, etc..
poolType
,
String
the name of the pool
poolName
,
int
the pool max size, or -1 if the number cannot be determined
maxPoolSize
)

Provides the pool metrics SPI.

public default void
vertxCreated(Vertx
the instance of Vertx
vertx
)

Callback to signal when the Vertx instance is fully initialized.

Inherited from io.vertx.core.metrics.Measured:
isMetricsEnabled
Inherited from io.vertx.core.spi.metrics.Metrics:
close

Method Detail

createClientMetricsback to summary
public default ClientMetrics<?, ?, ?, ?> createClientMetrics(SocketAddress remoteAddress, String type, String namespace)

Provides the client metrics SPI when a client has been created.

No specific thread and context can be expected when this method is called.

Parameters
remoteAddress:SocketAddress

the server remote address

type:String

the metrics type, e.g http or ws

namespace:String

an optional namespace for scoping the metrics

Returns:ClientMetrics<?, ?, ?, ?>

the client metrics SPI or null when metrics are disabled

createDatagramSocketMetricsback to summary
public default DatagramSocketMetrics createDatagramSocketMetrics(DatagramSocketOptions options)

Provides the datagram/udp metrics SPI when a datagram socket is created.

No specific thread and context can be expected when this method is called.

Parameters
options:DatagramSocketOptions

the options used to create the DatagramSocket

Returns:DatagramSocketMetrics

the datagram metrics SPI or null when metrics are disabled

createEventBusMetricsback to summary
public default EventBusMetrics<H> createEventBusMetrics()

Provides the event bus metrics SPI when the event bus is created.

No specific thread and context can be expected when this method is called.

This method should be called only once.

Returns:EventBusMetrics<H>

the event bus metrics SPI or null when metrics are disabled

createHttpClientMetricsback to summary
public default HttpClientMetrics<?, ?, ?, ?> createHttpClientMetrics(HttpClientOptions options)

Provides the http client metrics SPI when an http client has been created.

No specific thread and context can be expected when this method is called.

Parameters
options:HttpClientOptions

the options used to create the HttpClient

Returns:HttpClientMetrics<?, ?, ?, ?>

the http client metrics SPI or null when metrics are disabled

createHttpServerMetricsback to summary
public default HttpServerMetrics<?, ?, ?> createHttpServerMetrics(HttpServerOptions options, SocketAddress localAddress)

Provides the http server metrics SPI when an http server is created.

No specific thread and context can be expected when this method is called.

Note: this method can be called more than one time for the same localAddress when a server is scaled, it is the responsibility of the metrics implementation to eventually merge metrics. In this case the provided server argument can be used to distinguish the different HttpServerMetrics instances.

Parameters
options:HttpServerOptions

the options used to create the HttpServer

localAddress:SocketAddress

localAddress the local address the net socket is listening on

Returns:HttpServerMetrics<?, ?, ?>

the http server metrics SPI or null when metrics are disabled

createNetClientMetricsback to summary
public default TCPMetrics<?> createNetClientMetrics(NetClientOptions options)

Provides the net client metrics SPI when a net client is created.

No specific thread and context can be expected when this method is called.

Parameters
options:NetClientOptions

the options used to create the NetClient

Returns:TCPMetrics<?>

the net client metrics SPI or null when metrics are disabled

createNetServerMetricsback to summary
public default TCPMetrics<?> createNetServerMetrics(NetServerOptions options, SocketAddress localAddress)

Provides the net server metrics SPI when a net server is created.

No specific thread and context can be expected when this method is called.

Note: this method can be called more than one time for the same localAddress when a server is scaled, it is the responsibility of the metrics implementation to eventually merge metrics. In this case the provided server argument can be used to distinguish the different TCPMetrics instances.

Parameters
options:NetServerOptions

the options used to create the NetServer

localAddress:SocketAddress

localAddress the local address the net socket is listening on

Returns:TCPMetrics<?>

the net server metrics SPI or null when metrics are disabled

createPoolMetricsback to summary
public default PoolMetrics<?> createPoolMetrics(String poolType, String poolName, int maxPoolSize)

Provides the pool metrics SPI.

Parameters
poolType:String

the type of the pool e.g worker, datasource, etc..

poolName:String

the name of the pool

maxPoolSize:int

the pool max size, or -1 if the number cannot be determined

Returns:PoolMetrics<?>

the thread pool metrics SPI or null when metrics are disabled

vertxCreatedback to summary
public default void vertxCreated(Vertx vertx)

Callback to signal when the Vertx instance is fully initialized. Other methods can be called before this method when the instance is being constructed.

Parameters
vertx:Vertx

the instance of Vertx